2 Replies Last post: Jul 7, 2009 9:54 AM by Santiago Suarez Ordoñez  
Kris143 Beginner 15 posts since
Mar 25, 2008
Currently Being Moderated

Jul 6, 2009 3:42 PM

Help with Xpath...

Could you please help me write Xpath to validate the amounts especially the amounts ($ 393.44, $ 296.67, $ 296.67). These amounts are same everytime in my testcase. 

 

1st payment on July 7, 2009 of $ 393.44

2nd payment on August 7, 2009 of $ 296.67

3rd payment on September 7, 2009 of $ 296.67

 

 

I was trying to use XPather(and firebug) and it gives whole text (i.e text between <ol> tags)? 

 

 

<ol>
        <li>Method: <strong>Credit Card</strong></li>
        <li></li>
        <li>Card Number:<strong>XXXXXXXX1111</strong></li>
        <p>
               <strong>Payment Schedule</strong>
        </p>
                           1st payment on July 7, 2009 of $ 393.44
        <br/>
                           2nd payment on August 7, 2009 of $ 296.67
         <br/>
                          3rd payment on September 7, 2009 of $ 296.67
         <br/>
</ol>

daScientist Advanced 64 posts since
Jun 1, 2009
Currently Being Moderated
1. Jul 7, 2009 9:48 AM in response to: Kris143
Re: Help with Xpath...

I think you need to enclose each of your payments inside some html element -

otherwise they reside inside <ol> so the XPath is right... and you need to parse all the <ol> internal text.

Santiago Suarez Ordoñez Almighty 998 posts since
Aug 7, 2008
Currently Being Moderated
2. Jul 7, 2009 9:54 AM in response to: daScientist
Re: Help with Xpath...

You can parse that using JavaScript regular expressions:

This should help:

http://seleniumhq.org/docs/04_selenese_commands.html#javascript-and-selenese-parameters

 

Saludos

Santi

More Like This

  • Retrieving data ...