Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timed out waiting 45 seconds for Firefox to start

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)
like image 933
Dhinakaran Avatar asked Dec 06 '22 13:12

Dhinakaran


2 Answers

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.

like image 114
bjones01001101 Avatar answered Dec 30 '22 09:12

bjones01001101


I haved this error for 2 days in WIndows, the solution for me was in Set.Plataform put Plataform.ANY or Plataform.Windows because Plataform.WIN10 not worked, marionette wasn't necessary and I added and neether works, only works this. I hope this helps someone else:

public class Main {
    public static RemoteWebDriver driver;

    public static void main(String[] args) throws MalformedURLException {
        System.setProperty("webdriver.gecko.driver", "D:/Lib/geckodriver.exe");
        DesiredCapabilities desiredCapabilities = new DesiredCapabilities().firefox();
        desiredCapabilities.setPlatform(Platform.ANY);
        desiredCapabilities.setBrowserName("firefox");

        driver = new RemoteWebDriver(new URL("http://172.20.19.182:5557/wd/hub"), desiredCapabilities);
        driver.navigate().to("http://www.google.com");
        driver.findElementByName("q").sendKeys("execute automation");
        driver.findElementByName("q").sendKeys(Keys.ENTER);
        driver.close();
        // write your code here
    }
}
like image 44
Rose8525 Avatar answered Dec 30 '22 08:12

Rose8525