使用Selenium WebDriver和Firefox 50.0运行C#测试时提供了无效参数异常

时间:2016-12-01 17:33:27

标签: c# selenium-webdriver visual-studio-2013 firefox-marionette

我正在学习Selenium WebDriver并尝试使用Firefox 50和Webdriver 3.0.1运行一个简单的测试。我正在使用Marionette驱动程序0.11.1

我有以下代码:

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"P:\Selenium Practice\FirefoxDriver", "wires.exe");
service.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";
FirefoxOptions options = new FirefoxOptions();
options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true);
TimeSpan time = TimeSpan.FromSeconds(10);
IWebDriver driver = new FirefoxDriver(service, options, time);
driver.Navigate().GoToUrl("http://www.demoqa.com");

运行时,我收到以下异常,错误代码为10022:

enter image description here

它说:“System.dll中发生了'System.Net.Sockets.SocketException'类型的未处理异常”

我并没有真正得到我做错的事。我去了很多建议,其中没有一个真的有效。我在这里描述的最后一个是:Setting up Marionette/ GeckoDriver

我该怎么做才能解决它?

0 个答案:

没有答案