AW: [Webtest] JavaSkript-Error

Brandon Moore webtest@lists.canoo.com
Thu, 26 Jun 2003 10:21:24 -0500


This really sounds like a javascript error, just looking at the message:

>  [testSpec] TypeError: [object Control] is not a
> function. (httpunit; line
> 6)

it sounds like the javascript has pulled an object out of the dom and
is trying to call it rather than one of its methods, like

document.forms[0]('test')

rather then

document.forms[0].getElementsByName('test')

I would see if the Javascript is right. Looking at the DOM specs from
W3C, mozilla, microsoft, and the HttpUnit Javascript might help. Seeing the
Javascript would help. You might want to look at the page in a recent
version
of netscape (I know 7 has this, at least) and look for error messages in the
"Javascript Console".

Well, that assumes you have the Javascript is broken and you have the power
to fix the javascript. If the Javascript is right but HttpUnit doesn't like
it,
I would talk to the HttpUnit people. If it's broken, you can't have it
fixed,
and the page doesn't work without it, I don't know what to do.
com.meterware.httpunit.HttpUnitOptions.setExceptionsThrownOnScriptError
sounds promising, but if I remember correctly, script errors in onSubmit
still
aborted a form submit. netscape and i.e. continue after an error so it
didn't
work out so well. If you haven't asked there already, the
HttpUnit mailing list might be a good place to ask for help.


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 6:31 AM
To: webtest@lists.canoo.com
Subject: Re: AW: [Webtest] JavaSkript-Error


Hi,

I used to face similar problems with JS unless i
realised that the JS being wrriten wasnt quite good...

For eg if i had a JS with something like "a.getlist"
it wouldnt work... but "document.a.getlist" would!

Strange but i face such problems everyday... I am not
a JS guru so could be wrong...

If you remove your js.jar...JS support is turned off
and in some cases where you use JS on ur web
pages...the tcs might fail.


Cheers!
Aatish

--- "Stein A.,DP ITS,SMK,EF" <A.Stein@deutschepost.de>
wrote:
> Hi Mike,
>
> thanks for this information. I have do it. The error
> message don't see it.
>
> Regards,
> Annett
>
> -----Urspr|ngliche Nachricht-----
> Von: Friedrich Mike (KAFC 31)
> [mailto:mike.friedrich@credit-suisse.com]
> Gesendet am: Mittwoch, 25. Juni 2003 08:37
> An: 'webtest@gate.canoo.com'
> Betreff: RE: [Webtest] JavaSkript-Error
>
> HI Annett
>
> go in your WEBTEST_HOME directory
> there u will find a lib directory
> in there should be a file named js.jar
> rename that file into something like js.jar-off
>
> recheck the html-page
> bingo - the error message should not appear anymore
>
> cheers mike
>
>
>
>
> -----Original Message-----
> From: Stein A.,DP ITS,SMK,EF
> [mailto:A.Stein@deutschepost.de]
> Sent: Wednesday, June 25, 2003 7:20 AM
> To: 'webtest@gate.canoo.com'
> Subject: AW: [Webtest] JavaSkript-Error
> Importance: Low
>
>
> Hi Mike,
>
> thank You for Your answer. What can I make, that
> this error not to see it?
> Can you explain me?
>
> Thanks,
> Annett
>
> -----Urspr|ngliche Nachricht-----
> Von: Friedrich Mike (KAFC 31)
> [mailto:mike.friedrich@credit-suisse.com]
> Gesendet am: Dienstag, 24. Juni 2003 16:00
> An: 'webtest@gate.canoo.com'
> Betreff: RE: [Webtest] JavaSkript-Error
>
> HI Anett
>
> I had the same error when I started with WebTest.
> Contacted Canoo.
>
> They told be to uncomment the js.jar -file in
> WEBTEST_HOME/lib driectory
> Since this library checks the Javascript-part
> embedded in html. But this
> library is quite error-prone.
>
> The disadvantage of this is, that your javascript
> code will not be checked.
> But works fine for my purposes.
>
> Cheers mike
>
>
>
>
> -----Original Message-----
> From: Stein A.,DP ITS,SMK,EF
> [mailto:A.Stein@deutschepost.de]
> Sent: Tuesday, June 24, 2003 3:48 PM
> To: 'webtest@lists.canoo.com'
> Subject: [Webtest] JavaSkript-Error
>
>
> Hello,
>
> I have follow error:
>
>
> D:\Programme\canoo_webtest\doc\samples>ant
> -buildfile
>
D:\Programme\canoo_webtest\doc\samples\simpleSmartphil.xml
> Buildfile:
>
D:\Programme\canoo_webtest\doc\samples\simpleSmartphil.xml
>
> clean:
>    [delete] Deleting 5 files from
> D:\tmp\SmartPhilDemo
>
> main:
>  [testSpec] TypeError: [object Control] is not a
> function. (httpunit; line
> 6)
>  [testSpec]     at
>
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:590)
>  [testSpec]     at
>
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:550)
>  [testSpec]     at
>
org.mozilla.javascript.NativeGlobal.typeError1(NativeGlobal.java:560)
>  [testSpec]     at
>
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1184)
>  [testSpec]     at
> org.mozilla.javascript.gen.c22.call(httpunit:6)
>  [testSpec]     at
>
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2179)
>  [testSpec]     at
>
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:58)
>  [testSpec]     at
>
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(J
> avaScript.java:162)
>  [testSpec]     at
>
com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelega
> te.java:52)
>  [testSpec]     at
>
com.meterware.httpunit.FormControl.sendOnChangeEvent(FormControl.java:226)
>  [testSpec]     at
>
com.meterware.httpunit.SelectionFormControl.claimUniqueValue(FormControl.jav
> a:898)
>  [testSpec]     at
>
com.meterware.httpunit.FormParameter.setValues(FormParameter.java:90)
>  [testSpec]     at
>
com.meterware.httpunit.WebForm.setParameter(WebForm.java:519)
>  [testSpec]     at
>
com.canoo.webtest.steps.request.ClickButton.addParameter(ClickButton.java:23
> 3)
>  [testSpec]     at
>
com.canoo.webtest.steps.request.ClickButton.setParameters(ClickButton.java:1
> 79)
>  [testSpec]     at
>
com.canoo.webtest.steps.request.ClickButton.doExecute(ClickButton.java:90)
>  [testSpec]     at
> com.canoo.webtest.steps.Step.execute(Step.java:59)
>  [testSpec]     at
>
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
>  [testSpec]     at
>
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
> va:55)
>  [testSpec]     at
> org.apache.tools.ant.Task.perform(Task.java:341)
>  [testSpec]     at
> org.apache.tools.ant.Target.execute(Target.java:309)
>  [testSpec]     at
>
org.apache.tools.ant.Target.performTasks(Target.java:336)
>  [testSpec]     at
>
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
>  [testSpec]     at
>
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
>  [testSpec]     at
> org.apache.tools.ant.Main.runBuild(Main.java:609)
>  [testSpec]     at
> org.apache.tools.ant.Main.start(Main.java:196)
>  [testSpec]     at
> org.apache.tools.ant.Main.main(Main.java:235)
>
> BUILD FAILED
>
file:D:/Programme/canoo_webtest/doc/samples/simpleSmartphil.xml:10:
> Test
> failed.
> Exception raised:
> com.meterware.httpunit.ScriptException: Event
> 'setAction('reload');' failed: TypeError: [object
> Control] is not a functi
>  (httpunit; line
> 6)com.meterware.httpunit.ScriptException: Event
> 'setAction('reload');' failed: TypeError: [object
> Control] is not a func
> on. (httpunit; line 6)
>         at
>
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptEx
> ception(JavaScript.java:191)
>         at
>
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(J
> avaScript.java:165)
>         at
>
com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelega
> te.java:52)
>         at
>
com.meterware.httpunit.FormControl.sendOnChangeEvent(FormControl.java:226)
>         at
>
com.meterware.httpunit.SelectionFormControl.claimUniqueValue(FormControl.jav
> a:898)
>         at
>
com.meterware.httpunit.FormParameter.setValues(FormParameter.java:90)
>         at
>
com.meterware.httpunit.WebForm.setParameter(WebForm.java:519)
>         at
>
com.canoo.webtest.steps.request.ClickButton.addParameter(ClickButton.java:23
> 3)
>         at
>
com.canoo.webtest.steps.request.ClickButton.setParameters(ClickButton.java:1
> 79)
>         at
>
=== message truncated ===


=====
========================
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