【问题标题】:The HTTP request to the remote WebDriver server for URL http://localhost:6444/session timed out after 60 seconds对 URL http://localhost:6444/session 的远程 WebDriver 服务器的 HTTP 请求在 60 秒后超时
【发布时间】:2018-03-22 23:03:30
【问题描述】:

我目前在 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:对远程的 HTTP 请求 URL http://localhost:6444/session 的 WebDriver 服务器在之后超时 60 秒。 ---> System.Net.WebException: 操作超时

当前使用的版本:

  • Firefox 56.0 64 位
  • 硒 3.5.1
  • Geckodriver v0.19.0 64bit

有人可以指导我解决这个问题吗?

【问题讨论】:

  • 你在使用firefoxprofile
  • @iamsankalp89 我添加了这一行:FirefoxProfile profile = new FirefoxProfile();但是,结果是一样的。

标签: c# selenium webdriver


【解决方案1】:

在启动 FirefoxDriver 的代码中添加这个

通过引用这个answer

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

【讨论】:

  • 您好,感谢您的回复,我试过了,但是没有用。为了让它工作,我必须在服务器上创建一个 geckodriver 进程。
  • 好吧,让我试试其他的
猜你喜欢
  • 2019-06-28
  • 2017-09-03
  • 2019-02-21
  • 2014-04-14
  • 1970-01-01
  • 2018-11-15
  • 1970-01-01
  • 2017-05-06
  • 2023-03-19
相关资源
最近更新 更多