Timed out waiting 45 seconds for Firefox to start

我怕爱的太早我们不能终老 提交于 2020-01-21 05:32:09

问题


I am using 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)

回答1:


I faced this issue and finally found the answer. I had been referencing the Marionette driver which is no longer correct for FF version 53 and up on Selenium 3.5 or higher. The GeckoDriver documentation displays how the system property should be referenced.

I changed my code from:

System.setProperty("webdriver.firefox.marionette", System.getProperty("user.dir") + "path");  

to:

System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "path");  

and now my local Firefox works perfectly.

Hope this helps others.




回答2:


use implicit wait before get method, it will wait for the page to load eg:

driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);


来源:https://stackoverflow.com/questions/47504392/timed-out-waiting-45-seconds-for-firefox-to-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!