Hi,
I am facing a problem to parse the below datastructure,basically its an array of hashes.All i want to do is write a script which will access testcase1 and perform each steps in an order. I need to access step1 from testcase1 and trigger the command with the given parameters , the command here is the name of a function module which is a part of another perl script which i have written and the parameters are the arguments for my function. Once step1 is completed i need to perform step2 on my application, i also need a way to synchronise my steps every step has to be executed based on the return status of the previous step or result of the previous step. If step1 fails it has to exit and should not perform step2. After testcase1 is executed it has to goto testcase2 and perform the operations. Can anyone please suggest me how i can implement a solution for this.?Looking forward for your help
@VAR1 = {
'testcase1' => {
'step1' => {
'command' => 'Launchapplication ',
'param1' => 'executablepath',
'param2' => 'dirpath'
},
'step2' => {
'command' => 'SelectMenu'
},
'step3' => {
'command' => 'Changemode',
'param1' => '100'
},
'step4' => {
'command' => 'CaptureRectanlge',
'param1' => '3',
'param2' => '96',
'param3' => '726',
'param4' => '580'
},
'step5' => {
'command' => 'CompareImage',
'image1' => 'D:\\\\img1.jpg',
'image2' => 'D:\\\\img2.jpg '
}
},
'testcase2' => {
'step1' => {
'command' => 'Launchapplication ',
'param1' => 'executablepath',
'param2' => 'dirpath'
},
'step2' => {
'command' => 'Dothis'
},
'step3' => {
'command' => 'Changemode',
'param1' => '100'
},
'step4' => {
'command' => 'CaptureRectanlge',
'param1' => '3',
'param2' => '96',
'param3' => '726',
'param4' => '580'
},
'step5' => {
'command' => 'CompareImage',
'image1' => 'D:\\\\img1.jpg',
'image2' => 'D:\\\\img2.jpg '
}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.