com.gargoylesoftware.htmlunit.ScriptException

TypeError: Cannot read property "element" from null (Window.eval()#1)

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web236

Stack trace

  • com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "element" from null (Window.eval()#1) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:704) at com.gargoylesoftware.htmlunit.javascript.host.Window.jsxFunction_eval(Window.java:898) 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:324) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142) at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:468) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2090) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2984) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:151) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:160) at org.mozilla.javascript.Context.evaluateString(Context.java:1132) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:252) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:704) at com.gargoylesoftware.htmlunit.html.HtmlScript.appendChild(HtmlScript.java:187) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.handleCharacters(HTMLParser.java:419) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:380) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:367) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2831) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:313) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:227) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:112) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:85) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:431) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389) at com.gargoylesoftware.htmlunit.WebTestCase.loadPage(WebTestCase.java:204) at com.gargoylesoftware.htmlunit.WebTestCase.loadPage(WebTestCase.java:155) at com.gargoylesoftware.htmlunit.javascript.host.WindowTest.testEvalScope2(WindowTest.java:1991) 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:324) at junit.framework.TestCase.runTest(TestCase.java:154) at com.gargoylesoftware.htmlunit.WebTestCase.runTest(WebTestCase.java:407) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) 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: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "element" from null (Window.eval()#1) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3226) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3216) at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3232) at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3251) at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3264) at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1321) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2815) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:163) at org.mozilla.javascript.Context.evaluateString(Context.java:1132) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:252) ... 59 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitor2 times, last one
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
JurajiJuraji
5 times, last one
Unknown visitor
Unknown visitorOnce,