Hi,
HtmlUnit seems not to allow to define a variable named undefined as
browsers do. Even if is surely not a good coding style for your JS code,
it is a bug in HtmlUnit. Please open a ticket for it.
Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com
Thomas Klein wrote:
Hi,
I'm not an expert... but to me, it looks like it's rather an error in
the javascript code you are testing against than an error in your
webtest script(s).
Not sure however... and I also believe that the "correct" error message
should be something like
redeclaration of const <const name> undefined.
Perhaps this error you see is just the "tip of the iceberg" ;)
HTH,
Thomas
*Thomas Klein***
Senior Associate, QA | *Sapient*
------------------------------------------------------------------------
*From:* [email protected]
[mailto:[email protected]] *On Behalf Of *Aparna Shankar
*Sent:* Thursday, February 04, 2010 2:16 AM
*To:* [email protected]
*Subject:* [Webtest] Unexpected exception caught:
net.sourceforge.htmlunit.corejs.javascript.WrappedException
Hi,
I am trying to run my test case and I encounter the following error.
I ran through my code looking for redeclaration of the keyword
"const" but found none.
I am not sure what else to look for.
Does this look familiar to anyone?
Thanks in advance
-Aparna
Unexpected exception caught:
net.sourceforge.htmlunit.corejs.javascript.WrappedException
at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:122)
at com.canoo.webtest.steps.Step.handleException(Step.java:387)
at com.canoo.webtest.steps.Step.execute(Step.java:118)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at
com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
at
com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:293)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:218)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by:
net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped
com.gargoylesoftware.htmlunit.ScriptException: TypeError:
redeclaration of const undefined.
at
net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1797)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:564)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:620)
at
com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1255)
at
com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1213)
at
com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1180)
at
com.canoo.webtest.steps.request.ClickLink.findTarget(ClickLink.java:70)
at
com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(AbstractTargetAction.java:72)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
... 69 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError:
redeclaration of const undefined.
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:526)
at
net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:424)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:931)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:360)
at
com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:224)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:239)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:693)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:651)
at
org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1132)
at
org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1034)
at
org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at
org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3058)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1994)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:907)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:897)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
at
com.canoo.webtest.engine.Configuration$3.createPage(Configuration.java:659)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:414)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:297)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:322)
at
com.gargoylesoftware.htmlunit.javascript.host.html.HTMLFormElement$2.execute(HTMLFormElement.java:249)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:559)
... 76 more
Caused by:
net.sourceforge.htmlunit.corejs.javascript.EvaluatorException:
TypeError: redeclaration of const undefined.
at
com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeError(StrictErrorReporter.java:82)
at
net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:961)
at
net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1017)
at
net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError1(Context.java:980)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.redefineProperty(ScriptableObject.java:2034)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.initScript(ScriptRuntime.java:3242)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.initFrame(Interpreter.java:2691)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:840)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at
com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:261)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:415)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520)
... 107 more
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest