2017-10-11 26 views
0

我目前在使用selenium初始化Firefox时遇到问题。这个问题似乎只发生在Windows Server 2012 r2上,因为我在本地机器上尝试了相同的配置(Windows 10),并且它没有问题。对http:// localhost:6444/session的远程WebDriver服务器的HTTP请求在60秒后超时

我目前使用此代码(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: The HTTP request to the remote WebDriver server for URL http://localhost:6444/session timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out

当前版本:

  • 火狐56.0 64位
  • 硒3.5.1
  • Geckodriver v0.19.0 64bit

有人可以引导我通过这个问题吗?

+0

是否使用firefoxprofile – iamsankalp89

+0

@ iamsankalp89我已经加入这一行: FirefoxProfile配置=新FirefoxProfile(); 但是,结果是一样的。 – user1343543

回答

0

在代码中添加这个关于开展FirefoxDriver

通过引用该answer

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

嗨感谢您的答复,我试过,但它没有奏效。 对于它的工作,我不得不在服务器上创建一个geckodriver进程。 – user1343543

+0

好吧,让我试试其他的 – iamsankalp89