[Webtest] Javascript Support

Brandon Moore webtest@lists.canoo.com
Thu, 26 Jun 2003 13:04:09 -0500


Hi Aatish

I'd like a copy of the patch.

onclick on a submit button seems to work.

When I tested a page with an onClick attribute on a anchor tag I got a wierd
error:
java.lang.NoClassDefFoundError:
com/meterware/httpunit/javascript/JavaScript$Control
	at inv1.invoke()
	at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:498)
	at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:413)
	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2169)
	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2163)
	at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:58)
	at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(J
avaScript.java:162)
	at
com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelega
te.java:52)
	at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:568)
	<more stack trace>

The strange part is that HttpUnit does define that class. I have no idea why
this is happening. I don't need support for this (the pages I'm testing just
use javascript for form validation), but it really shouldn't be crashing
like
that. If I had the time I'd recode the test in pure HttpUnit and see if it
has
the same problem.

Brandon

-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Aatish Arora
Sent: Thursday, June 26, 2003 12:08 PM
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Javascript Support


Hi Brandon,

Officially Canoo has support for the onClick() on
Submit.
(yet! :) )

Well canoo doesent apparently inhert all the
Javascript support HTTPunit has...

I do have some patches for alert boxes and
confirmations if you would need them...

Besides someone had posted a patch for setting hidden
fields...I guess I would have it too - if your
interested i could mail it to you.

Cheers!
Aatish


--- Brandon Moore <bmoore@commcode.com> wrote:
> The Canoo webpage claims Javascript isn't supported.
> (at least the page at
> http://webtest.canoo.com/webtest/manual/install.html
> maybe there is another?)
> HttpUnit does Javascript, so shouldn't canoo just
> inherit supprt? I know the
> onSubmit action on a
> form is processed correctly, so I'm wondering if
> those warnings are out of
> date? On the other hand,
> it looks like the code for clicklink ignores the
> onClick attribute (if it
> used click() instead of getRequest()
> it would hit the javascript).
>
> How well is Javascript supported in canoo? Is there
> any place I could get
> accurate information about
> what works without looking through the source?
>
> On a related topic, is there any way to set hidden
> fields of a form without
> extending canoo? The
> setinput step can't find the hidden field. If it
> could, I think httpunit's
> parameter validation would
> complain
> (HttpUnitOptions.setParameterValuesVallidated
> controls this). I
> wrote a "setHiddenField"
> task that uses the
>
form.getScriptableObject().setProperty("field","value")
> idiom, but I'm wondering
> if there is a better way.
>
> Thanks
> Brandon
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest


=====
========================
THE FOUR STAGES OF LIFE:

1) You believe in Santa Claus.
2) You don't believe in Santa Claus.
3) You are Santa Claus.
4) You look like Santa Claus.
========================

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest