[Webtest] Re: problems with verifyxpath
Wed, 28 Apr 2004 10:12:26 -0400
I can't get your attachments because they are encoded in ASCII in the
digest, and my e-mail client doesn't recognize it. Can you just put text
in your reply? Best (and this is just good debugging practice), make a web
page and test script that are as small as possible while still exhibiting
the problem. (You might find the problem this way, too.) Then copy the
text of these small files into your reply.
Without seeing your page and the text, I can only guess that maybe jTidy is
rewriting your <a> element to <A>, although that seems like strange
behavior. Also, I have tests that test for <a> that aren't having any
problems (but I am using an older webtest distribution).
The text=null in your results just refers to the fact that you don't
provide a text attribute on your verifyxpath step. It doesn't signify a
problem, it is just letting you know everything about your failing test.
Date: Tue, 27 Apr 2004 10:44:41 +0200
From: Massimiliano Mauri <firstname.lastname@example.org>
Subject: Re: [Webtest] Re: problems with verifyxpath
> how looks the page you're testing on?
(I'm using the build 432, on JDK1.4.2 in Eclipse2.1.1)
(the page not contains frames.)
Attached you find a zip with the build.xml and the results of the test
(with also the compiled pages saved during test)
(only the page in which I use the verifyxpath step)
I'm testing a webapp.
Steps of test:
invoke login page,
setting username e password,
loading a node,
(see the results/results.html file for simplicity)
>> 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
> 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
yes, but in the report (stacktrace) I have (as above):
"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",
Reading the report, it was mine first thought/doubt.
Testing other times, I have partially solved this problem:
<verifyxpath xpath="//a".../> fails, but <verifyxpath xpath="//A".../>
no. (See the results.html.)
but... Why, if in the tested page I have a tag <a> and not <A>?
Another question: see the report of test 2 and 6: I'm searching a link
with label "Sposta su" ("Move up") in the page. This link exists in the
page, but the test fails (with xpath="//A" and with xpath="//a"). Why?
because is in a "bad table"?
I have another problem (with setinputfield tag), but I will send another