[Webtest] Re: problems with verifyxpath

Christopher Painter-Wakefield webtest@lists.canoo.com
Wed, 28 Apr 2004 10:12:26 -0400




Max,

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.

Christopher




Date: Tue, 27 Apr 2004 10:44:41 +0200
From: Massimiliano Mauri <massimiliano.mauri@wise-lab.it>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Re: problems with verifyxpath
Reply-To: webtest@lists.canoo.com


> 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,
    check  xpath.


(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
>> 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
>
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",
stepType="verifyxpath") ".
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
message

thanks
max

<attachments snipped>