jquery js error message...

224 views
Skip to first unread message

Kevin Gann

unread,
Jul 21, 2009, 8:10:16 PM7/21/09
to webd...@googlegroups.com
I'm trying to figure out what exactly is wrong on a page when I use htmlunit as using the iexplore and firefox drivers don't have the same problem.

It appears related to this bug... but unfortunately the bug doesn't go much into what was wrong on the page. ;) I assume it's the thickbox-compressed.js being evaluated with null?

http://jira.codehaus.org/browse/GRAILSPLUGINS-895

Console output...

TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)

Here's my stack trace...

org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
System info: os.name: 'Windows Vista', os.arch: 'amd64', os.version: '6.0', java.version: '1.5.0_18'
Driver info: driver.version: htmlunit
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:229)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:212)
    at com.ii4sm.icsr.test.IcsrLoginTest.loginTest(IcsrLoginTest.java:59)
    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:534)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:464)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:992)
    at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:138)
    at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:184)
    at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:584)
    at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:936)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
    at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:941)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1237)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:183)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:449)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:223)
    ... 26 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3698)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2221)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:3143)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:2487)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:267)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:492)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:457)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
    ... 43 more


Ahmed Ashour

unread,
Jul 22, 2009, 3:34:18 AM7/22/09
to webd...@googlegroups.com
Dear Kevin,
 
Which HtmlUnit version do you use? As there is continuous improvement in JavaScript area. Please try latest 2.6-SNAPSHOT if you are using another version.
 
Also, can you send your complete html/js, so we can reproduce the error.
 
Yours,
Ahmed
----
Blog: http://asashour.blogspot.com

From: Kevin Gann <kay...@gmail.com>
To: webd...@googlegroups.com
Sent: Wednesday, July 22, 2009 3:10:16 AM
Subject: [webdriver] jquery js error message...

I'm trying to figure out what exactly is wrong on a page when I use htmlunit as using the iexplore and firefox drivers don't have the same problem.

It appears related to this bug... but unfortunately the bug doesn't go much into what was wrong on the page. ;) I assume it's the thickbox-compressed.js being evaluated with null?

http://jira.codehaus.org/browse/GRAILSPLUGINS-895

Console output...

TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)

Here's my stack trace...

org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
System info: os.name: 'Windows Vista', os.arch: 'amd64', os.version: '6.0', java.version: '1.5.0_18'
Driver info: driver.version: htmlunit
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:229)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:212)
    at com.ii4sm.icsr.test.IcsrLoginTest.loginTest(IcsrLoginTest.java:59)
    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable..run(ReflectiveCallable.java:15)
    at org.junit.runners..model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:534)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:464)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:992)
    at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:138)
    at com..gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:184)
    at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:584)
    at com.gargoylesoftware.htmlunit.html.HtmlElement$2..run(HtmlElement.java:936)

    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
    at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:941)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1237)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:183)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:449)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:223)
    ... 26 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "click" of null (http://kurdt:8080/icsr_framework/jquery/js/thickbox-compressed.js#11(eval)#1)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime..constructError(ScriptRuntime.java:3654)

    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
    at net.sourceforge.htmlunit.corejs..javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3698)

Kevin Gann

unread,
Jul 22, 2009, 1:13:18 PM7/22/09
to webd...@googlegroups.com
I'm using the HTMLUnit 2.5 included within the webdriver-all-1039.zip. I've attached the js referenced in the stack trace/error as requested.

It appears my developer has used a package from http://www.codylindley.com...

kg
thickbox-compressed.js

Sully

unread,
Aug 3, 2009, 12:34:48 AM8/3/09
to webdriver
Hi guys. I'm seeing something similar as well. I updated the
htmlunit jar to the latest 2.6 snapshot and got a different error:

SEVERE: runtimeError: message=[Unexpected exception occurred while
parsing HTML snippet: Property 'http://cyberneko.org/html/properties/
balance-tags/fragment-context-stack' is not recognized.] sourceName=
[http://gwrrd2:8180/cc/resources/javascript/global.js?ver=5.0.2.p4]
line=[4434] lineSource=[null] lineOffset=[0]
Wrapped com.gargoylesoftware.htmlunit.ScriptException: Unexpected
exception occurred while parsing HTML snippet: Property 'http://
cyberneko.org/html/properties/balance-tags/fragment-context-stack' is
not recognized. (http://gwrrd2:8180/cc/resources/javascript/global.js?
ver=5.0.2.p4#4434) (http://gwrrd2:8180/cc/resources/javascript/
global.js?ver=5.0.2.p4#5923)

I didn't see a v2.6 for the core-js jar on the cruise instance so
assumed the 2.6 snapshot should be run with 2.5?

Strangely enough some other folks have successfully used htmlunit v2.5
with webtest to functional test the same app.

I will try and dig a bit deeper to get a the point of being able to
reproduce...

Cheers

Ben
Reply all
Reply to author
Forward
0 new messages