[Webtest] Error in Canoo with ...httpunit.ParsedHTML when using <ClickButton>

Dierk Koenig webtest@lists.canoo.com
Fri, 22 Oct 2004 10:00:09 +0200


the easiest way is to drop js support.
To this end remove the js.jar from your classpath.
(note that renaming doesn't help)

a cleaner way is to put a nested option in your config
<config>
	…
	<option name="ScriptingEnabled" value="false"/>
	…
</config>

cheers
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Xavier MOGHRABI
> Sent: Freitag, 22. Oktober 2004 9:47
> To: webtest@gate2.canoo.com
> Subject: Re: [Webtest] Error in Canoo with ...httpunit.ParsedHTML when
> using <ClickButton>
>
>
> Hi,
>
> The button doesn't have an onclick attribute. But it's write that
> the page
> belongs a javascript file like this :
>  <script type="text/javascript" src="../js/admin.js"></script>
>
> I can access the script with my browser without problem.
>
> This doesn't look to be useful for me. So is there any way to
> disable it with
> Canoo.
>
> Thanks for your help.
>
> --
> Xavier MOGHRABI - Consortium ObjectWeb
> Email : xavier.moghrabi at inrialpes.fr
> Phone : +33 4 76 61 55 25
>
> Le vendredi 22 Octobre 2004 09:11, Dierk Koenig a écrit :
> > Hi Xavier,
> >
> > it seems your button has an onclick handler that calls a javascript
> > function. The functions resides in an external file that is
> > referenced by your html page. HttpUnit gets an IOException
> > when trying to fetch this file. It may not be there or not
> > accessible.
> >
> > cheers
> > Mittie
> >
> > > -----Original Message-----
> > > From: webtest-admin@lists.canoo.com
> > > [mailto:webtest-admin@lists.canoo.com]On Behalf Of Xavier MOGHRABI
> > > Sent: Donnerstag, 21. Oktober 2004 19:22
> > > To: webtest@gate2.canoo.com
> > > Subject: [Webtest] Error in Canoo with ...httpunit.ParsedHTML
> when using
> > > <ClickButton>
> > >
> > >
> > > Hello
> > >
> > > I used the latest build of Canoo (537) and I 've got an
> > > incomprehensible (for
> > > me) error when I click on a button. It looks for coming from HTTPUNIT.
> > >
> > > In fact I try to post a new article in the www.LinuxFR.org website.
> > >
> > > Here's the error. I join by the way the Canoo xml file.
> > >
> > > [testSpec]  INFO (Step.java:233) - Start Step: null "[implict setup
> > > step]" (1/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: invoke
> "<unknown>" (2/17)
> > >  [testSpec]  INFO (Target.java:144) - -> gotoTarget(by url):
> > > http://localhost:2000/pub
> > >  [testSpec]  INFO (Context.java:186) - Current form set to none
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > login" (3/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > password" (4/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: clickbutton "Login"
> > > (5/17) [testSpec]  INFO (ClickButton.java:139) - Button found :Submit
> > > with Envoyer=Connexion
> > >  [testSpec]  INFO (ClickButton.java:152) - -> gotoTarget(by Button):
> > > name=Envoyer value=Connexion
> > >  [testSpec]  INFO (Context.java:186) - Current form set to none
> > >  [testSpec]  INFO (Step.java:233) - Start Step: clicklink "Click
> > > to post an
> > > article..." (6/17)
> > >  [testSpec]  INFO (Context.java:186) - Current form set to none
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > email" (7/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setselectfield
> > > "<unknown>" (8/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setselectfield
> > > "<unknown>" (9/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > title" (10/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > summary" (11/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield
> > > "<unknown>" (12/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield
> > > "<unknown>" (13/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setselectfield
> > > "<unknown>" (14/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: setinputfield "Set the
> > > message" (15/17)
> > >  [testSpec]  INFO (Step.java:233) - Start Step: clickbutton
> > > "Preview..." (16/17)
> > >  [testSpec]  INFO (ClickButton.java:139) - Button found :Submit with
> > > confirm=Visualiser
> > >  [testSpec]  INFO (ClickButton.java:152) - -> gotoTarget(by Button):
> > > name=confirm value=Visualiser
> > >  [testSpec] ERROR (Step.java:370) - Cannot handle unexpected
> > > exception in step
> > > ClickButton at
> > > /usr/local/canoo-537/submission/LinuxFR/testLFR.xml:43:  with
> > > (label="Visualiser", stepId="Preview...", stepType="clickbutton")
> > >  [testSpec] java.lang.RuntimeException: Error loading included script:
> > > java.io.IOException
> > >  [testSpec]     at
> > > com.meterware.httpunit.ParsedHTML.getScript(ParsedHTML.java:341)
> > >  [testSpec]     at
> > > com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTM
> > > L.java:319)
> > >  [testSpec]     at com.meterware.httpunit.ParsedHTML.access$700
> > > (ParsedHTML.java:37)
> > >  [testSpec]     at
> > > com.meterware.httpunit.ParsedHTML$ScriptFactory.recordElement(Pars
> >
> > edHTML.java:489)
> >
> > >  [testSpec]     at
> > >
> com.meterware.httpunit.ParsedHTML$2.processElement(ParsedHTML.java:702)
> > >  [testSpec]     at
> > > com.meterware.httpunit.NodeUtils$PreOrderTraversal.perform(NodeUti
> > > ls.java:195)
> > >  [testSpec]     at
> > > com.meterware.httpunit.ParsedHTML.loadElements(ParsedHTML.java:718)
> > >  [testSpec]     at
> > > com.meterware.httpunit.ParsedHTML.getForms(ParsedHTML.java:106)
> > >  [testSpec]     at
> > >
> com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:688)
> > >  [testSpec]     at
> > > com.meterware.httpunit.javascript.JavaScript.load(JavaScript.java:89)
> > >  [testSpec]     at
> > > com.meterware.httpunit.javascript.JavaScriptEngineFactory.load(Jav
> >
> > aScriptEngineFactory.java:58)
> >
> > >  [testSpec]     at
> > >
> com.meterware.httpunit.RequestContext.runScripts(RequestContext.java:44)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:122)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebWindow.sendRequest(WebWindow.java:110)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSo
> > > urce.java:253)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSo
> > > urce.java:232)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebForm.submitRequest(WebForm.java:96)
> > >  [testSpec]     at
> > > com.meterware.httpunit.WebForm.doFormSubmit(WebForm.java:107)
> > >  [testSpec]     at
> com.meterware.httpunit.WebForm.submit(WebForm.java:69)
> > >  [testSpec]     at
> > >
> com.canoo.webtest.steps.request.ClickButton.doClick(ClickButton.java:176)
> > >  [testSpec]     at
> com.canoo.webtest.steps.request.ClickButton.access$1
> > > (ClickButton.java:167)
> > >  [testSpec]     at
> > >
> com.canoo.webtest.steps.request.ClickButton$2.call(ClickButton.java:157)
> > >  [testSpec]     at
> > > com.canoo.webtest.steps.request.Target.setLastWindowResponse(Targe
> > > t.java:290)
> > >  [testSpec]     at
> > >
> com.canoo.webtest.steps.request.ClickButton$1.call(ClickButton.java:155)
> > >  [testSpec]     at
> > > com.canoo.webtest.steps.request.Target.protectedGoto(Target.java:104)
> > >  [testSpec]     at
> > > com.canoo.webtest.steps.request.ClickButton.gotoTarget(ClickButton
> > > .java:150)
> > >  [testSpec]     at
> > > com.canoo.webtest.steps.request.ClickButton.doExecute(ClickButton.
> > > java:143)
> > >  [testSpec]     at com.canoo.webtest.steps.Step.execute(Step.java:118)
> > >  [testSpec]     at
> > > com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)
> > >  [testSpec]     at
> > > com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificat
> > > ionTask.java:68)
> > >  [testSpec]     at
> > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> > >  [testSpec]     at org.apache.tools.ant.Task.perform(Task.java:364)
> > >  [testSpec]     at
> org.apache.tools.ant.Target.execute(Target.java:341)
> > >  [testSpec]     at
> > > org.apache.tools.ant.Target.performTasks(Target.java:369)
> > >  [testSpec]     at
> > > org.apache.tools.ant.Project.executeTarget(Project.java:1214)
> > >  [testSpec]     at
> > > org.apache.tools.ant.Project.executeTargets(Project.java:1062)
> > >  [testSpec]     at org.apache.tools.ant.Main.runBuild(Main.java:673)
> > >  [testSpec]     at org.apache.tools.ant.Main.startAnt(Main.java:188)
> > >  [testSpec]     at
> > > org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> > >  [testSpec]     at
> > > org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> > >
> > > BUILD FAILED
> > > /usr/local/canoo-537/submission/LinuxFR/testLFR.xml:20: Test failed.
> > > Exception raised:
> > > com.canoo.webtest.engine.StepExecutionException: Unexpected
> > > exception caught: java.lang.RuntimeException: Error loading
> > > included script:
> > > java.io.IOException, Step: ClickButton
> > > at /usr/local/canoo-537/submission/LinuxFR/testLFR.xml:43:  with
> > > (label="Visualiser", stepId="Preview...",
> > >
> stepType="clickbutton")com.canoo.webtest.engine.StepExecutionException:
> > > Unexpected exception caught: java.lang.RuntimeException: Error loading
> > > included script: java.io.IOException, Step: ClickButton
> > > at /usr/local/canoo-537/submission/LinuxFR/testLFR.xml:43:  with
> > > (label="Visualiser", stepId="Preview...", stepType="clickbutton")
> > >         at
> > > com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:371)
> > >         at
> > > com.canoo.webtest.steps.request.Target.protectedGoto(Target.java:113)
> > >         at
> > > com.canoo.webtest.steps.request.ClickButton.gotoTarget(ClickButton
> > > .java:150)
> > >         at
> > > com.canoo.webtest.steps.request.ClickButton.doExecute(ClickButton.
> > > java:143)
> > >         at com.canoo.webtest.steps.Step.execute(Step.java:118)
> > >         at
> com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)
> > >         at
> > > com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificat
> > > ionTask.java:68)
> > >         at
> > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> > >         at org.apache.tools.ant.Task.perform(Task.java:364)
> > >         at org.apache.tools.ant.Target.execute(Target.java:341)
> > >         at org.apache.tools.ant.Target.performTasks(Target.java:369)
> > >         at
> org.apache.tools.ant.Project.executeTarget(Project.java:1214)
> > >         at
> org.apache.tools.ant.Project.executeTargets(Project.java:1062)
> > >         at org.apache.tools.ant.Main.runBuild(Main.java:673)
> > >         at org.apache.tools.ant.Main.startAnt(Main.java:188)
> > >         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> > >         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> > >
> > > Do you have any idea ?
> > >
> > > Thanks for your help.
> > >
> > > --
> > > Xavier MOGHRABI - Consortium ObjectWeb
> > > Email : xavier.moghrabi at inrialpes.fr
> > > Phone : +33 4 76 61 55 25
> >
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>