Hi Monks.
I tried several ways to parse the below XML but was not successful in doing so, i am new to XML and perl and i am seeking an help here. My task is to parse the below xml structure.My script has to perform the below operations.
1)Goto Testcase1 and access the step1 and perform the command mentioned in step1 with the provided parameters.The command is defined in another perl file as a function module and it should be triggered with the specified parameters.My script should perform step2 based on the return value of command1 if its success it should execute command 2 else exit from the script and goto testcase2. I am absolutely clueless about the approach i should take , can anyone suggest how to solve this. A code snippet would be very helpful.
<testcase1>
<step1 command ="Launchapp " param1 = "executablepath" param2 = "d
+irpath"/>
<step2 command = "Dothis"/>
<step3 command = "Changemode" param1 = "100"/>
<step4 command = "CaptureRectanlge" param1 = "3" param2 = "96" par
+am3 = "726" param4 = "580"/>
<step5 command = "CompareImage" image1 = "D:\\img1.jpg" image2 = "
+D:\\img2.jpg "/>
</testcase1>
<testcase2>
<step1 command ="Launchapp " param1 = "executablepath" param2 = "d
+irpath"/>
<step2 command = "Dothis"/>
<step3 command = "Changemode" param1 = "100"/>
<step4 command = "CaptureRectanlge" param1 = "3" param2 = "96" par
+am3 = "726" param4 = "580"/>
<step5 command = "CompareImage" image1 = "D:\\img1.jpg" image2 = "
+D:\\img2.jpg "/>
</testcase2>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|