[Webtest] verifyXPath problem

Dale Ogilvie webtest@lists.canoo.com
Thu, 15 Jun 2006 15:12:19 +1200


Hello,

I wanted to verify the contents of a cell deep within an html page
generated by our webapp. I saved the html from the browser and used xpe
to locate the node of interest. Xpe generated this xpath:
string(/html/body/table[1]/tbody/tr/td[5]/table/tr[2]/td[2]/form/table/t
r/td/table/tbody/tr[1]/td[2])

Now if I include the verifyXPath element in my test

<verifyXPath description=3D"Check for price"
xpath=3D"string(/html/body/table[1]/tbody/tr/td[5]/table/tr[2]/td[2]/form=
/
table/tr/td/table/tbody/tr[1]/td[2])"
text=3D"$5295.00&amp;nbsp&amp;nbsp&amp;nbspEach" />

The test fails with:

"xpath test:
string(/html/body/table[1]/tbody/tr/td[5]/table/tr[2]/td[2]/form/table/t
r/td/table/tbody/tr[1]/td[2]) evaluates to: , expected value is:
$5295.00&nbsp&nbsp&nbspEach"

If I take the failed response html and then open it with xpe, the xpath
above *does* resolve to the correct string. Can someone suggest how to
resolve this? I assume it is showing up a difference between xpe and the
xpath implementation used in webtest. The beauty of verifyXPath is that
it provides a nicely focused way to get at data deep within the DOM, it
would be a shame to have to fall back to verifyText.

Thanks

--
Dale Ogilvie
Trimble Navigation NZ Ltd