[Webtest] XPath: Absolut element location versus conditional branch (new in English)

Daniel Sheppard webtest@lists.canoo.com
Thu, 28 Nov 2002 12:02:42 +1100


I believe I see your problem:

<verifyxpath stepid=3D"check 6" xpath=3D"//tr[td=3DEUR]" text=3D"VV" rege=
x=3D"false"/>

//tr[td=3DEUR] is not testing what you want it to.

This would look for a structure in your document like so:

<TR>
=09<TD>xfasd</TD>
=09<EUR>xfasd</EUR>
</TR>

You need to enclose the string EUR in single quotes.

//tr[td=3D'EUR']

Also for this problem:
surprisingly the following step was working also (i expected the need of =
text=3D".*ASIA.*"):
<verifyxpath stepid=3D"check 4" xpath=3D"/html/body/table[2]/tr[3]" text=3D=
"ASIA" regex=3D"true"/>

A regex looks for a partial string. If you want an exact match, what you =
need is text=3D"^ASIA$" where the ^ is denoting the start of the string a=
nd the $ the end.

If regex is false does webtest's match use a partial or an exact match?

Daniel Sheppard
eCommerce Developer
Pronto Software Pty Ltd
Phone: +61-3-9887-7770   Fax: +61-3-9887-7779
#########################################################################=
############
This email has been scanned by MailMarshal, an email content filter.
#########################################################################=
############