C# 为什么Firefox48的Selenium GECKO驱动程序不能启动服务器?
我们在.Net自动化测试项目设置中作为NUnit测试项目运行Selenium 2.5.3 Firefox47一切都很好。但是Firefox48停止了工作。 我从github中下载了Gecko.exe(版本9)。 我几乎可以让它运行,但不完全可以 我遇到了以下错误: 其他信息:对远程WebDriver服务器的URL HTTP请求在30秒后超时 其他信息:对远程WebDriver服务器的URL HTTP请求在30秒后超时 似乎默认情况是使用随机端口。 因此,我手动将其设置为端口7500,在Windows防火墙中打开该端口,现在我得到了以下结果: 其他信息:无法在上启动驱动程序服务 以下是我在WebDriverFactory中的代码:C# 为什么Firefox48的Selenium GECKO驱动程序不能启动服务器?,c#,.net,selenium,firefox,selenium-webdriver,C#,.net,Selenium,Firefox,Selenium Webdriver,我们在.Net自动化测试项目设置中作为NUnit测试项目运行Selenium 2.5.3 Firefox47一切都很好。但是Firefox48停止了工作。 我从github中下载了Gecko.exe(版本9)。 我几乎可以让它运行,但不完全可以 我遇到了以下错误: 其他信息:对远程WebDriver服务器的URL HTTP请求在30秒后超时 其他信息:对远程WebDriver服务器的URL HTTP请求在30秒后超时 似乎默认情况是使用随机端口。 因此,我手动将其设置为端口7500,在Windo
case WebDriverType.Firefox:
Log.Info("Starting Firefox ...");
//string driverPath =
// $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)}\\wires.exe";
string driverPath =
@"C:\Development2\iRePORT\src\test\csharp\Nete.Ireport.EndToEndTests\bin\Debug\geckodriver.exe";
FirefoxDriverService driverService = FirefoxDriverService.CreateDefaultService();
driverService.FirefoxBinaryPath = driverPath;
driverService.Port = 7500;
FirefoxOptions ffOptions = new FirefoxOptions();
ffOptions.IsMarionette = true;
driver = new FirefoxDriver(driverService, ffOptions, TimeSpan.FromSeconds(30));
// driver = new FirefoxDriver(new FirefoxOptions());
Log.Info("Started");
break;
我在这上面花了很多时间,我觉得我已经很接近了。
有人知道我丢了什么吗
我现在读了一些让我想到这句话的东西
driverService.FirefoxBinaryPath = driverPath;
指向要使用的Firefox版本的vesion。
现在,我已将driverpath和可执行文件名放入driverService构造函数中,如下所示:
case WebDriverType.Firefox:
Log.Info("Starting Firefox ...");
//string driverPath =
// $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)}\\wires.exe";
string driverPath =
@"C:\Development2\iRePORT\src\test\csharp\Nete.Ireport.EndToEndTests\bin\Debug";
string driverExecutableName = "geckodriver.exe";
FirefoxDriverService driverService = FirefoxDriverService.CreateDefaultService(driverPath, driverExecutableName);
// Don't do this!!! This is the executable to the Firefox Version executable.
//driverService.FirefoxBinaryPath = driverPath;
driverService.Port = 7500;
FirefoxOptions ffOptions = new FirefoxOptions();
ffOptions.IsMarionette = true;
driver = new FirefoxDriver(driverService, ffOptions, TimeSpan.FromSeconds(30));
// driver = new FirefoxDriver(new FirefoxOptions());
Log.Info("Started");
break;
现在我又回到了这个错误:
其他信息:无法在上启动驱动程序服务
如果我有: driverService.Port=7200; 它说“找不到实体”。我相信这意味着它找不到Gecko.exe。 如果我有: driverService.Port=7500; 它说:
其他信息:无法在上启动驱动程序服务请尝试Selenium 3.0.0。我也遇到了这个问题,但我最终管理了所有的东西,从2.53.1切换到3.0.0在这里发布了一个可能与此问题相关的答案