HtmlUnit 2.23 + Selenium 2.53.1的例外情况

时间:2017-01-23 17:28:09

标签: selenium cucumber automated-tests htmlunit

当我尝试执行HtmlUnit 2.23 + Selenium 2.53.1时出错。

完整的日志是:

org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getUrl
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'XXX', ip: '0.0.0.0', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_60'
Driver info: driver.version: HtmlUnitDriver
  at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:554)
  at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:530)
  at utils.MyDriverExecutor.getDriver(MyDriverExecutor.java:86)
  at utils.MyExecution.accessURL(MyExecution.java:22)
  at utils.MyExecution.acessaSistema(MyExecution.java:60)
  at com.mycompany.mysoftware.steps.LoginSteps.queEstouNaTelaDeLoginDoSistema(LoginSteps.java:22)
  at ✽.Dado que estou na tela de login do sistema(/trunk/test/testCases/1-LoginCadastroNovoCliente.feature:10)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getUrl
  at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:921)
  at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628)
  at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515)
  at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:803)
  at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:779)
  at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:975)
  at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:352)
  at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:238)
  at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:257)
  at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:772)
  at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
  at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:729)
  at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1209)
  at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1111)
  at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:207)
  at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:337)
  at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3137)
  at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2100)
  at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:927)
  at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:506)
  at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:459)
  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
  at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:979)
  at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:241)
  at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:187)
  at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:269)
  at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:157)
  at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:512)
  at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
  at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
  at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451)
  at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:541)
  at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:530)
  at utils.MyDriverExecutor.getDriver(MyDriverExecutor.java:86)
  at utils.MyExecution.accessURL(MyExecution.java:22)
  at utils.MyExecution.acessaSistema(MyExecution.java:60)
  at com.mycompany.mysoftware.steps.LoginSteps.queEstouNaTelaDeLoginDoSistema(LoginSteps.java:22)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at cucumber.runtime.Utils$1.call(Utils.java:37)
  at cucumber.runtime.Timeout.timeout(Timeout.java:13)
  at cucumber.runtime.Utils.invoke(Utils.java:31)
  at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
  at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
  at cucumber.runtime.Runtime.runStep(Runtime.java:299)
  at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
  at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
  at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
  at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
  at cucumber.runtime.Runtime.run(Runtime.java:121)
  at cucumber.api.cli.Main.run(Main.java:36)
  at cucumber.api.cli.Main.main(Main.java:18)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Caused by: java.lang.NullPointerException
  at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.getUrl(WebSocket.java:256)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at net.sourceforge.ht

mlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)   ... 74更多

HtmlUnit没有调用任何测试用例(Cucumber)

0 个答案:

没有答案