[Webtest] Re: problems with verifyxpath

Marc Guillemot webtest@lists.canoo.com
Mon, 26 Apr 2004 15:21:53 +0200


Hi Massimiliano,

see comment in text

> Hi.
> I'm testing a web application and I have some problems with 
> <verifyxpath...>
> 
> This steps seems not work. For example, searching in the page a link 
> with the step <verifyxpath stepid="verify xpath 1" xpath="//a"/> canoo 
> web test get a failure message 
> (com.canoo.webtest.engine.StepFailedException).
> 
> In the report Canoo WebTest returns this message
> com.canoo.webtest.engine.StepFailedException: xpath test: //a matched no 
> nodes, Step: VerifyXPath at file:C:/.../test/build.xml:29: with 
> (text="null", stepId="verify xpath 1", xpath="//a", regex="false", 
> stepType="verifyxpath")
> 
> I'm tryng also with <verifyxpath stepid="verify xpath 1" 
> xpath="//a[@href='myPage.jsp']"/>, but I have the same result. (and the 
> link exists in the tested page)

how looks the page you're testing on?

> 
> My first question is: this step search an <a> tag in the page HTML with 
> label "null"? why?
> reading the syntax reference if the text attribute is not specified 
> <verifyxpath> "...match at least one node in the document object model..."

why with label "null"?
...xpath="//a" ... -> tests if there is at least 1 link in the page
...xpath="//a[@href='myPage.jsp']"... -> tests if there is a link with href="myPage.jsp" in the page

> The page HTML may be a simple HTML or have to be a XHTML?

normal html is ok, the html parser allows to see it as well structured xml

> I have another question: <verifyxpath> supports XSLfunctions like 
> count(), text()...?

yop

> I hope somebody will be able to help me...

I hope I do

Marc.