我正在使用Ubuntu 16.04
Timed out waiting 45 seconds for Firefox to start. Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:31.527Z' System info: host: 'supranimbus-Inspiron-3250', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-40-generic', java.version: '1.8.0_151' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.firefox.XpiDriverService.waitUntilAvailable(XpiDriverService.java:131) at org.openqa.selenium.firefox.XpiDriverService.start(XpiDriverService.java:116) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600) 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 org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98) at facedoxmain.FaceDox.InvokeBrowser(FaceDox.java:17) at facedoxmain.FaceDox.main(FaceDox.java:57) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:20033/hub/status] to be available after 45005 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) at org.openqa.selenium.firefox.XpiDriverService.waitUntilAvailable(XpiDriverService.java:129)
我遇到了这个问题,终于找到了答案。我一直在使用Marionette驱动程序,该驱动程序不再适用于FF版本53和Selenium 3.5或更高版本。该GeckoDriver文档显示系统属性应该如何引用。
我从以下位置更改了代码:
System.setProperty("webdriver.firefox.marionette", System.getProperty("user.dir") + "path");
至:
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "path");
现在我的本地Firefox运行正常。
希望这对其他人有帮助。