[Webtest] JavaSkript-Error

Friedrich Mike (KAFC 31) webtest@lists.canoo.com
Tue, 24 Jun 2003 16:00:26 +0200


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
com.canoo.webtest.steps.request.ClickButton.doExecute(ClickButton.java:90)
        at com.canoo.webtest.steps.Step.execute(Step.java:59)
        at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
        at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:55)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

The HTML-Code like to see out so:

<SELECT SIZE="1"  NAME="kundengruppe" onChange="setAction('reload');">
		<option value="">- bitte ausw&auml;hlen -</option>
		<option value="PS">Privatkunde</option>
		<option value="GK">Geschäftskunde</option>
		<option value="PE">Mitarbeiter DPAG</option>

</select>

Can You help me!

Mit freundlichen Grüßen

Annett Stein
Middelware/Webtechnologie
Java Enterprise Solutions 8
Entwicklung

Deutsche Post ITSolutions GmbH
Postfach 90 01 14
99104 Erfurt

tel. 		+49 (0) 361 2236 933
fax 		+49 (0) 361 2236 979
email	 	mailto:A.Stein@deutschepost.de
internet 	http://www.dp-itsolutions.de

Besucher- und Lieferadresse:
Gustav-Weisskopf-Str. 04
99092 Erfurt

1.Etage, Raum 1.49

This email is confidential. If you are not the intended recipient, you must
not disclose or use the information contained in it.If you have received
this mail in error, please tell us immediately by return email and delete
the document.

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