首页 文章

对URL http:// localhost:6444 / session的远程WebDriver服务器的HTTP请求在60秒后超时

提问于
浏览
0

我目前在使用selenium初始化Firefox时遇到了问题 . 这个问题似乎只发生在Windows Server 2012 r2上,因为我在我的本地计算机(Windows 10)上尝试了相同的配置,并且它没有问题 .

我目前正在使用此代码(C#):

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService("Path to Drivers folder", "geckodriver.exe");
                    service.Port = 6444;
                    service.FirefoxBinaryPath = "Firefox installation path";
                    ffDriver = new FirefoxDriver(service);

但是,它返回此错误:

OpenQA.Selenium.WebDriverException:远程WebDriver服务器对URL http:// localhost:6444 / session的HTTP请求在60秒后超时 . ---> System.Net.WebException:操作已超时

正在使用的当前版本:

  • Firefox 56.0 64位

  • Selenium 3.5.1

  • Geckodriver v0.19.0 64bit

有人可以指导我完成这个问题吗?

1 回答

  • 0

    在启动FirefoxDriver的代码中添加它

    通过引用这个answer

    ffDriver=   new FirefoxDriver(new FirefoxBinary(),new FirefoxProfile(),TimeSpan.FromSeconds(120));
    

相关问题