Exception in thread “main” org.openqa.selenium.WebDriverException: Timed out waiting 45 seconds for Firefox to start after geckodriver upgradation

前端 未结 2 866
时光说笑
时光说笑 2021-01-20 22:12

I have written the below code in java to just open the firefox and redirect to gmail.com link, but seems its getting timed out before redirection. I have checked for the sol

2条回答
  •  Happy的楠姐
    2021-01-20 23:10

    I haved this error for 2 days, the solution for me was in Set.Plataform put Platafor.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
        }
    }
    

提交回复
热议问题