[Webtest] Another verifyXPath query question
Tim Miller
webtest@lists.canoo.com
Tue, 18 Oct 2005 08:19:27 -0700
Denis,
Both of your suggestions return null and the closing span is not a typo.
I am looking into that with the developer right now.
Thanks,
Tim
-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Denis N. Antonioli
Sent: Monday, October 17, 2005 12:00 PM
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Another verifyXPath query question
Hi Tim
your xpath looks for:
<tr>
<td>
<span title=3D"OrdLineNum">76011-2</span>
<td>
<span title=3D"ProdId">76011</span>
</td>
</td>
</tr>
That is, with the 2nd td inside the first td -- provided that the way =20
the span are closed is a typo ;-)
What you want is either something like:
//table/tbody/tr[td/span[@title=3D'ProdId']]/td[2]
=3D~ locate the 2nd td in the tr in which a td has a span with the =20
title ProdId
or
//table/tbody/tr/td[span/@title=3D'ProdId']/following-sibling::td[1]
=3D~ locate the first td follwing a td with a span with the title ProdId
My experience with jaxen up to 1-1 beta 6, the version distributed =20
with webtest, is xpath with following-sibling work in more cases than =20
xpath with complicated selections.
The tbody is needed in all cases.
Happy webtesting
dna
On 17 oct. 05, at 20:21, Tim Miller wrote:
> Any idea why I cannot get this verifyXPath to work? It always =20
> returns null. I tried a few variations on this query including =20
> adding the tbody.
>
>
>
>
>
> <verifyXPath stepid=3D"check table"
>
> xpath=3D"//table/tr/td/span[@title=3D'ProdId']/td[2]"
>
> text=3D"76011"/>
>
>
>
>
>
> HTML:
>
>
>
> <table border=3D"1" cellspacing=3D"0" cellpadding=3D"1">
>
> <tr>
>
> <th>OrdLineNum</th>
>
> <th>ProdId</th>
>
> </tr>
>
> <tr>
>
> <td>
>
> <span title=3D"OrdLineNum"/>
>
> 76011-2
>
> </span>
>
> </td>
>
> <td>
>
> <span title=3D"ProdId"/>
>
> 76011
>
> </span>
>
> </td>
>
>
>
>
>
> (This email message is for the sole use of the intended recipient=20
> (s) and may contain confidential information. Any unauthorized =20
> review, use, disclosure or distribution is prohibited. If you are =20
> not the intended recipient, please contact the sender by reply =20
> email and destroy all copies of the original message.)
>
>
>
>
--=20
Exercise and tax refunds have something in common - a little is better
than none at all.
-- Scott Tinley and Ken McAlpine, Winning Guide to Sports Endurance
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest