• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

com.gargoylesoftware.htmlunit.ScriptException: TypeError: is not a function, it is undefined

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to run one webtest and getting following issue

In My web test on click of particular button one javascript funcation is getting clalled which is there in the js file.
By setting the level to debug in the log4j I can see that the particular js which is having that javascript function is getting downloaded then also while executing that function it is giving below error.

The HtmlUnit version which I am using is 2.7

com.gargoylesoftware.htmlunit.ScriptException: TypeError: isWhiteSpace is not a function, it is undefined.
[groovy] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:527)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
[groovy] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:457)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:910)
[groovy] at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:190)
[groovy] at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:209)
[groovy] at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:645)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:887)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:892)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1248)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1212)
[groovy] at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1179)
[groovy] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[groovy] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
[groovy] at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
[groovy] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
[groovy] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
[groovy] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
[groovy] at Script1.run(Script1.groovy:10)
[groovy] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:527)
[groovy] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:565)
[groovy] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:536)
[groovy] at com.canoo.webtest.extension.groovy.GroovyInvoker.doExecute(GroovyInvoker.java:40)
[groovy] at com.canoo.webtest.extension.groovy.GroovyStep.doExecute(GroovyStep.java:83)
[groovy] at com.canoo.webtest.steps.Step.execute(Step.java:103)
[groovy] at com.canoo.webtest.extension.groovy.GroovyStep.execute(GroovyStep.java:64)
[groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[groovy] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[groovy] at org.apache.tools.ant.Task.perform(Task.java:348)
[groovy] at com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
[groovy] at com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
[groovy] at com.canoo.webtest.steps.Step.execute(Step.java:103)
[groovy] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[groovy] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[groovy] at org.apache.tools.ant.Task.perform(Task.java:348)
[groovy] at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:293)
[groovy] at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:218)
[groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[groovy] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[groovy] at org.apache.tools.ant.Task.perform(Task.java:348)
[groovy] at org.apache.tools.ant.Target.execute(Target.java:357)
[groovy] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[groovy] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[groovy] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[groovy] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[groovy] at org.apache.tools.ant.Task.perform(Task.java:348)
[groovy] at org.apache.tools.ant.Target.execute(Target.java:357)
[groovy] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[groovy] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[groovy] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[groovy] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[groovy] at java.lang.reflect.Method.invoke(Method.java:585)
[groovy] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[groovy] at org.apache.tools.ant.Task.perform(Task.java:348)
[groovy] at org.apache.tools.ant.Target.execute(Target.java:357)
[groovy] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[groovy] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[groovy] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[groovy] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[groovy] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[groovy] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[groovy] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[groovy] Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: isWhiteSpace is not a function, it is undefined.
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3778)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3833)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1842)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2231)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1506)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
[groovy] at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:264)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
[groovy] at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
[groovy] at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:80)
[groovy] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:485)
[groovy] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:450)
[groovy] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:521)

Can anyone please suggest me what is the issue and how to resolve this?

Thanks & Regards,
Hetal
 
I've never won anything before. Not even a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic