AW: [Webtest] javascript capabilities

Stephane Ruffieux webtest@lists.canoo.com
Wed, 17 Mar 2004 13:37:51 +0100


Hi,

I have the same problem in an application that I have to test. HttpUnit
(canoo use hhtpunit) will try to support javascript 1.1 "as soon as
possible". You find what is supported at
http://httpunit.sourceforge.net/doc/javascript-support.html.

It does not means that all what is supported from httpunit is supported from
canoo (for example the onclick action of a link is not supported by
<clicklink>). It depends how it is implemented from canoo.

In the cas of a submit, the workaround is to use <invoke> to call the url.
In your example you can use the following test definition:

----- snip: extract from test.xml ----
<!-- click the submit button -->
<invoke
   stepid="submit with language = english"
   url="test2.html?lang=en" />
---- snip -------

In this case, it is very simple, but I have a lot of problems in my
application. I find canoo very good, simple, easy to integrate with ant, but
I ask me if it is the right tool to test an application which useS a lot of
javascript.


Stephane

-----Ursprungliche Nachricht-----
Von: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]Im Auftrag von netcetera
Gesendet: Mittwoch, 17. Marz 2004 12:03
An: webtest@lists.canoo.com
Betreff: [Webtest] javascript capabilities


hi everyone,

one of our web-application makes heavy use of js events. many form
fields have a 'onChange' event-handler installed. furthermore we
use ordinary '<a href="javascript:..."' expressions for form
submission and other stuff.

as far as i see the current webtest-suite does not support any
of this js-expressions.

   * are there any hints on how to handle these cases ?
   * are there any plans for supporting js in future releases ?

i think that modern applications makes very often use of js
expressions and js-links as they provide a much better feel
for the user.

cheers
urs

example html-code:
----- snip: test1.html -----
<html>
 <body>
  <h1>test page 1</h1>
  <form action="test2.html" method="get" name="test" accept-encoding="UTF-8"
>
   <select name="lang" size="1" onChange="submit()">
    <option value="de" selected>German</option>
    <option value="en">English</option>
   </select>
   <a href="javascript:document.test.submit();">click-me</a>
  </form>
 </body>
</html>
----- snip ---

----- snip: extract from test.xml ----
<!-- auto submit -->
<setselectfield
   stepid="swich test form"
   name="lang"
   value="en"/>
<!-- click the submit button -->
<clicklink
   stepid="click submit"
   label="click-me"/>
---- snip -------


_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest