[Webtest] Bug: Inconsequent behavior with verifyxpath!

Denis N. Antonioli webtest@lists.canoo.com
Tue, 22 Mar 2005 23:51:15 +0100


Hallo Marc

well, I think I understand the problem now.
As Mittie pointed out, the two steps works at different levels on the=20
document.

Verifytext works on the raw source, so it finds unprocessed=20
entities,but  Verifyxpath works on the dom, and it must obviously=20
parses the html document first. If it were xml, the parser would be=20
obliged to resolve all entities, I guess that's the case for html too.

Would it be possible for verifyxpath to translate the entities in the=20
text parameter?
verifytext would then succeed by comparing the entities (ü) in its=20=

parameter and in the html document, and verifyxpath would succeed=20
comparing the intended character (=FC) with whatever encoding webtest is=20=

running.

	dna

On 22 mars 05, at 10:10, Marc Guillemot wrote:

> Hi Denis,
>
> not sure that the xpath explorer would help in this case. It seems to=20=

> be an encoding issue and xpath explorer would bring its own encoding=20=

> "interpretation". What is the encoding returned by your webserver?=20
> What is the default encoding in the shell where you're running your=20
> webtest?
>
> Marc.
>
> Denis N. Antonioli wrote:
>> Hallo Mittie
>> I checked the document with xpath explorer. The dom shows a single=20
>> text()
>> for the complete <h2>...</h2>. In that text, the &uuml; has been=20
>> converted
>> to unicode \u00FC.
>> Thanks
>> 	dna
>> On Tue, 22 Mar 2005, Dierk Koenig wrote:
>>> Hi Denis,
>>>
>>> have you looked at it in the xpath explorer or some other
>>> dom visualizer? I guess there is some extra node in the dom for
>>> the uuml entity.
>>> The verifytext still doesn't fail because it works on the raw
>>> input, not on the dom.
>>>
>>> cheers
>>> Mittie
>>>
>>>
>>>> -----Original Message-----
>>>> From: webtest-admin@lists.canoo.com
>>>> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Denis N.=20
>>>> Antonioli
>>>> Sent: Montag, 21. Marz 2005 21:57
>>>> To: webtest@lists.canoo.com
>>>> Subject: [Webtest] Bug: Inconsequent behavior with verifyxpath!
>>>>
>>>>
>>>> Hi
>>>>
>>>> I just found a strange issue with the latest release of webtest:
>>>>
>>>> I'm checking a file that contains entities such as:
>>>>
>>>> <html>
>>>> <head>
>>>> </head>
>>>> <body>
>>>> <h2>Resultate f&uuml;r das Team 33</h2>
>>>> </body>
>>>> <html>
>>>>
>>>> In the webtest, I use alternatively the following two expression:
>>>> <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f&amp;uuml;r =
das=20
>>>> Team 33"/>
>>>> <verifytext text=3D"Resultate f&amp;uuml;r das Team 33"/>
>>>>
>>>> Obviously, both should work, but only verifytext is working.
>>>> The verifyxpath fails with:
>>>> /html/body/h2 evaluates to: Resultate f?r das Team 33, expected=20
>>>> value is: Resultate f&uuml;r das Team 33
>>>>
>>>>
>>>> Is this known?
>>>> Any hint on how to solve this?
>>>>
>>>>
>>>> Best
>>>> 	dna
>>>>
>>>> --=20
>>>> A vacuum is a hell of a lot better than some of the stuff that=20
>>>> nature
>>>> replaces it with.
>>>>   -- Tennessee Williams
>>>>

--=20
Sleep is a poor substitute for caffeine.
   -- Pat Dughi