Geckodriver突然开始失败

时间:2018-10-30 10:57:42

标签: java firefox geckodriver

驱动程序:geckodriver 0.19.1。

OS名称:Microsoft Windows 10 Pro for Workstations版本:10.0.17134 Build 17134。

Firefox:63.0(64位)。

使用TestNG版本6.14.0运行测试。

直到今天早上,一切正常。没有可察觉的Windows更新。

今天,浏览器闪烁并再次消失。 显示以下输出:

1540896320791   geckodriver INFO    geckodriver 0.19.1
1540896320798   geckodriver INFO    Listening on 127.0.0.1:21199
1540896321526   mozrunner::runner   INFO    Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\SStaple\\AppData\\Local\\Temp\\rust_mozprofile.3QimwYbs08Pl"
1540896322004   Marionette  DEBUG   Received observer notification profile-after-change
1540896322106   Marionette  DEBUG   Received observer notification toplevel-window-ready
1540896322129   Marionette  DEBUG   Received observer notification command-line-startup
1540896322130   Marionette  DEBUG   Received observer notification nsPref:changed
1540896322130   Marionette  DEBUG   Init aborted (running=false, enabled=true, finalUIStartup=false)
1540896322284   Marionette  DEBUG   Received observer notification toplevel-window-ready
1540896323003   Marionette  DEBUG   Received observer notification sessionstore-windows-restored
1540896323003   Marionette  DEBUG   Waiting for delayed startup...
1540896323080   Marionette  DEBUG   Setting recommended pref app.update.disabledForTesting to true
1540896323081   Marionette  DEBUG   Setting recommended pref security.turn_off_all_security_so_that_viruses_can_take_over_this_computer to true
1540896323082   Marionette  DEBUG   Setting recommended pref toolkit.cosmeticAnimations.enabled to false
1540896323083   Marionette  DEBUG   Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false
1540896323083   Marionette  DEBUG   Setting recommended pref dom.disable_beforeunload to true
1540896323117   Marionette  INFO    Listening on port 51662
1540896323117   Marionette  DEBUG   Remote service is active
1540896323562   Marionette  DEBUG   Accepted connection 0 from 127.0.0.1:51667
1540896323566   Marionette  TRACE   0 -> [0,1,"newSession",{"acceptInsecureCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptInsecureCerts":true,"browserName":"firefox"}}}]
1540896323566   Marionette  TRACE   0 <- [1,1,{"error":"unknown command","message":"newSession","stacktrace":"WebDriverError@chrome://marionette/content/error.js:178: ... et@chrome://marionette/content/server.js:245:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9\n"},null]
Oct 30, 2018 10:45:23 AM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected)
crossBrowserFramework.Driver                         error code: 1540893399 Error getting firefox driver. C:\Development\Alloy-Test\web-client\src\drivers\geckodriver.exe could not be found.
org.openqa.selenium.WebDriverException: newSession
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'SSTAPLE', ip: '172.16.190.147', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_151'
Driver info: driver.version: Driver
remote stacktrace: WebDriverError@chrome://marionette/content/error.js:178:5
UnknownCommandError@chrome://marionette/content/error.js:472:5
despatch@chrome://marionette/content/server.js:290:13
execute@chrome://marionette/content/server.js:271:11
onPacket/<@chrome://marionette/content/server.js:246:15
onPacket@chrome://marionette/content/server.js:245:8
_onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at crossBrowserFramework.Driver.getFirefoxDriver(Driver.java:114)
    at crossBrowserFramework.Driver.initialise(Driver.java:61)
    at crossBrowserFramework.CrossBrowserTest.initialiseDriver(CrossBrowserTest.java:598)
    at crossBrowserFramework.CrossBrowserTest.beforeSuite(CrossBrowserTest.java:174)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
    at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:451)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:401)
    at org.testng.SuiteRunner.run(SuiteRunner.java:364)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1127)
    at org.testng.TestNG.runSuites(TestNG.java:1039)
    at org.testng.TestNG.run(TestNG.java:1007)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

我不知道Firefox上一次更新的时间,但这可能是罪魁祸首。 有什么想法吗?

1 个答案:

答案 0 :(得分:2)

最新的gecko驱动程序是v0.23.0,请尝试对其进行更新。