com.gargoylesoftware.htmlunit.ScriptException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Jenkins has its own HtmlUnit module, that is downloaded throught Maven as dependency to jenkins test harness. But the module is rather old (2.6). This causes error while running JUnit tests {code} Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 19.895 sec <<< FAILURE! - in hudson.plugins.git.ui.ChangeSetListTest test1(hudson.plugins.git.ui.ChangeSetListTest) Time elapsed: 17.864 sec <<< ERROR! com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function querySelectorAll in object [object HTMLDocument]. (script in http://localhost:48448/job/test0/1/ from (45, 21) to (65, 14)#47) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3652) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3630) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3658) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3677) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3741) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216) {code} The method querySelectorAll() support has been added since 2.9 according to [HtmlUnit change log|http://htmlunit.sourceforge.net/changes-report.html#a2.9]. Simple substitution of new HtmlUnit causes failure in WebClient (Jenkins') constructor, as BrowserVersion has been changed: {code} Tests in error: FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite » NoSuchField PreBuildMergeOptionsTest.exporting:48 » NoSuchField FIREFOX_2 GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440- >testConfigRoundtripURLPreserved:1229->HudsonTestCase.configRoundtrip:888- >HudsonTestCase.createWebClient:1617 » NoSuchField GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440- >testConfigRoundtrip:1240->HudsonTestCase.configRoundtrip:888- >HudsonTestCase.createWebClient:1617 » NoSuchField {code}
    via by Pavel Baranchikov,
  • Jenkins has its own HtmlUnit module, that is downloaded throught Maven as dependency to jenkins test harness. But the module is rather old (2.6). This causes error while running JUnit tests {code} Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 19.895 sec <<< FAILURE! - in hudson.plugins.git.ui.ChangeSetListTest test1(hudson.plugins.git.ui.ChangeSetListTest) Time elapsed: 17.864 sec <<< ERROR! com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function querySelectorAll in object [object HTMLDocument]. (script in http://localhost:48448/job/test0/1/ from (45, 21) to (65, 14)#47) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3652) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3630) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3658) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3677) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3741) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216) {code} The method querySelectorAll() support has been added since 2.9 according to [HtmlUnit change log|http://htmlunit.sourceforge.net/changes-report.html#a2.9]. Simple substitution of new HtmlUnit causes failure in WebClient (Jenkins') constructor, as BrowserVersion has been changed: {code} Tests in error: FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite » NoSuchField PreBuildMergeOptionsTest.exporting:48 » NoSuchField FIREFOX_2 GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440- >testConfigRoundtripURLPreserved:1229->HudsonTestCase.configRoundtrip:888- >HudsonTestCase.createWebClient:1617 » NoSuchField GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440- >testConfigRoundtrip:1240->HudsonTestCase.configRoundtrip:888- >HudsonTestCase.createWebClient:1617 » NoSuchField {code}
    via by Pavel Baranchikov,
  • HtmlUnit does not recognize jQuery widgets
    via Stack Overflow by Earthstar
    ,
    • com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function querySelectorAll in object [object HTMLDocument]. (script in http://localhost:48448/job/test0/1/ from (45, 21) to (65, 14)#47) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3652) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3630) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3658) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3677) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3741) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216)
    No Bugmate found.