[Webtest] i18n - multibyte characters

Denis N. Antonioli webtest@lists.canoo.com
Mon, 29 Aug 2005 16:25:29 +0200


Hi

I've added a simplistic example to webtest's testsuite, it will be =20
available soon at:
<http://webtest.canoo.com/webtest/reports/selftest/=20
WebTestReport.html>, just look for 'showI18n'.


The gist of the story is that different webtest steps looks at =20
different informations .

In princip, webtest's verifyXXX steps looks at the html page as it =20
was send by the server.
So if, the test is looking for a '=FC', webtest must know how it was =20
encoded in the file, as a simple character,
as the html named entity '&uuml;', or as the html numeric entity =20
'&#x00fc;', or ...

Then, you must consider that an xml parser reads the file before =20
webtest sees its content.
So if you know that the html page contains, say, the named entity =20
&uuml;, and you want to call webtest with:
<verifyText text=3D"&uuml;" />,
the xml parser will complain that it doesn't know the entity uuml.

What you need to do is call webtest like this:
<verifyText text=3D"&amp;uuml;" />,
The xml parser will recognize the entity &amp; in &amp;uuml; and =20
replaces it with its value &, producing '&uuml;'.
This is what webtest will get and look for.

Confusing? Yes, it is, but there is more...

A few Webtest steps work on the DOM of the html page. In princip, =20
these steps are all related somehow to xpath.
In that case, htmlunit has translated all the entities into their =20
equivalent character when building the DOM.
So, you want to give webtest the character you're looking for:
<verifyXpath xpath=3D"//h1/text()" text=3D"=FC" />.

In that occasion, you may consider using a named entity, to make the =20
webtest file more robust in the presence of an heterogeneous testing =20
environment:
<verifyXpath xpath=3D"//h1/text()" text=3D"&#x00fc;" />.

See, we're using directly the numeric entity here, because we want =20
the xml parser to recognize and translate the entity before calling =20
webtest.

Happy testing
     dna


On 23 ao=FBt 05, at 14:12, Maud JAMATI wrote:

> Hi Meghanath,
>
> I did one simple test putting all the multibyte
> characters (only tested with europeans characters so
> far) in a properties file in UTF-8, and it was fine.
>
> Cheers,
> maud
>
> --- Chintakrindi Meghanath <Meghanath@NextLinx.com>
> wrote:
>
>
>> Hi Maud
>>
>> Have you found out that canoo supports the multibyte
>> characters ?
>>
>> Thanks
>> Meghanath
>>
>>
>>
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>>
>>
>
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide =20
> with voicemail http://uk.messenger.yahoo.com
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>

--=20
Did you read the documentation ? Even a little ? You're expected to
do that, really. It won't bite you.
   -- Ollivier Robert