[Webtest] Help needed: Encoding Bug in Webtest/underlying library?

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Wed, 20 Aug 2008 14:25:30 +0200


Hi Peter,

the list is correct.

Can you precise what your real problem is?

Indeed it seems to me that the problem you report concerns how the
current page state is dumped to a file. This looks like an error (you
can report an issue by HtmlUnit for that) but this has no impact on the
script execution.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


Peter Hoepfl wrote:
> Hello,
> 
> this is my first post to this list, I hope I'm doing this correct.
> 
> We have a problem with &quot; getting decoded twice in certain javascript code when invoked from Webtest.
> I managed to write a simple testcode that shows my problem, here is my testcode:
> 
> <html>
> <body>
> <a href="#" title="mytest" onclick="javascript:document.getElementById(&quot;test&quot;).innerHTML = document.getElementById(&quot;async&quot;).innerHTML;">do something</a>
> <div id="test">
> huh
> </div>
> <div id="async">
> <a href="#" title="test2" onclick="javascript:document.getElementById(&quot;testoutput&quot;).innerHTML = &quot;hello&quot;">do something more</a>
> </div>
> <div id="testoutput">
> </div>
> </body>
> </html>
> 
> When I run this webtest :
> 			<invoke url="/test.htm"/>
> 			<clickElement xpath="//a[@title='mytest']"/>
> 
> The resulting page looks like this:
> <html>
>   <head/>
>   <body>
>     <a href="#" title="mytest" onclick="javascript:document.getElementById(&quot;test&quot;).innerHTML = document.getElementById(&quot;async&quot;).innerHTML;">
>       do something
>     </a>
>     <div id="test">
>       <a href="#" title="test2" onclick="javascript:document.getElementById(" testoutput="">
>         do something more
>       </a>
>     </div>
>     <div id="async">
>       <a href="#" title="test2" onclick="javascript:document.getElementById(&quot;testoutput&quot;).innerHTML = &quot;hello&quot;">
>         do something more
>       </a>
>     </div>
>     <div id="testoutput">
>     </div>
>   </body>
> </html>
> 
> As you can see the &quot; gets decoded although it shouldn't leading to a broken javascript code in the test-div.
> When I perform the click in a regular browser the code is correct.
> To check simply save the code above to a file perfom the click in a regular browser.
> 
> Any idea what goes wrong?
> 
> 
> Best Regards,
> 
> Peter Höpfl
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>