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)

Jenkins JIRA | Pavel Baranchikov | 2 years ago
  1. 0

    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}

    Jenkins JIRA | 2 years ago | Pavel Baranchikov
    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)
  2. 0

    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}

    Jenkins JIRA | 2 years ago | Pavel Baranchikov
    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)
  3. 0

    HtmlUnit/Selenium HtmlUnitDriverで、HeadlessにAjaxを実行する - CLOVER

    ne.jp | 6 months ago
    com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addEventListener in object [object HTMLDocument]. (http://code.jquery.com/jquery-2.1.4.min.js#2)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Script error when using scriptaculous 1.7.0

    htmlunit | 10 years ago | skipoles
    com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function getElementsBySelector. (Embedded script in http://localhost:8080/simplescrum/test.html from (14, 13) to (0, 0)#3)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. HtmlUnit Core JS
      ScriptRuntime.getPropFunctionAndThis
      1. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3652)
      2. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3630)
      3. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3658)
      4. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3677)
      5. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3741)
      6. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249)
      7. net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216)
      7 frames