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:
Check out this post. This may help. http://howtoselenium.blogspot.ca/2016/08/this-is-how-to-use-selenium-geckodriver.html
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.