简体   繁体   中英

FindElement timeout in Selenium 3 - GeckoDriver

I updated my project to use Selenium 3.0.0-beta2 and Geckodriver instead the legacy implementation of FirefoxDriver. In all others browser all my tests still works without problem, but all my test methods and all FindElement action that I try to do in Gecko throws an exception:

WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:28957/session/17e03419-11f5-417f-be98-11d323f72a6a/elements timed out after 10 seconds.

Some methods still works without problem when I start a new instance of the FirefoxDriver using Gecko, like navigate to other window and execute javascript.

My Driver Setup:

    private static void SetupFirefoxDriver()
    {
        var driverService = FirefoxDriverService.CreateDefaultService(DriversPath, "geckodriver.exe");
        driverService.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\Firefox.exe";
        driverService.HideCommandPromptWindow = true;
        driverService.SuppressInitialDiagnosticInformation = true;

        var option = new FirefoxOptions();
        option.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true);
        option.AddAdditionalCapability("browser.download.folderList", 2);
        option.AddAdditionalCapability("browser.download.dir", Config.DiretorioDeDownload);
        option.AddAdditionalCapability("browser.download.downloadDir", Config.DiretorioDeDownload);
        option.AddAdditionalCapability("browser.download.defaultFolder", Config.DiretorioDeDownload);
        option.AddAdditionalCapability("browser.helperApps.neverAsk.saveToDisk", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/csv, application/pdf, application/octet-stream");

        SeleniumWebDriver.Driver = new FirefoxDriver(driverService, option, TimeSpan.FromSeconds(10));
    }

My config:

  • GeckoDriver 0.10,
  • Selenium 3.0.0-beta2,
  • Firefox 48.0.1,
  • Windows 10 64 bit,
  • geckodriver.exe 64 bit,
  • C#.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM