3 messages in com.canoo.lists.webtest[Webtest] verifyXPath problem
FromSent OnAttachments
Dale Ogilvie14 Jun 2006 20:11 
Marc Guillemot15 Jun 2006 00:21 
Dale Ogilvie15 Jun 2006 15:17 
Subject:[Webtest] verifyXPath problem
From:Dale Ogilvie (Dale@trimble.co.nz)
Date:06/14/2006 08:11:56 PM
List:com.canoo.lists.webtest

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="Check for price" xpath="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="$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