更新硒在Visual Studio 3.0和Firefox到47.0,現在我得到這個錯誤,當我嘗試使用本地webdriver模式: geckodriver.exe文件不存在於當前目錄或PATH環境變量的目錄中。如何設置硒3.0,獲取錯誤「geckodriver.exe文件不存在...」在c#
當我使用遠程模式(seleniumhub)時,即使使用firefox 45.0版本,它也能正常工作。
試圖尋找一些例子,但沒有發現任何東西的c#,只爲java,仍然無法使其工作。
我webdriver的設置:
switch (ConfigurationManager.AppSettings["WebDriverMode"].ToLower())
{
case "local":
switch (ConfigurationManager.AppSettings["WebDriverBrowserCapabilities"].ToLower())
{
case "firefox":
driver = new AdvancedFirefoxDriver();
break;
case "ie":
driver = new AdvancedInternetExplorerDriver();
break;
case "chrome":
driver = new AdvancedChromeDriver();
break;
default:
throw new NotImplementedException(string.Format("WebDriverBrowserCapabilities of \"{0}\" is not implemented for {1} mode", ConfigurationManager.AppSettings["WebDriverBrowserCapabilities"].ToLower(), ConfigurationManager.AppSettings["WebDriverMode"].ToLower()));
}
break;
case "remote":
var huburl = new Uri(ConfigurationManager.AppSettings["SeleniumHubAddress"]);
DesiredCapabilities capabilities;
switch (ConfigurationManager.AppSettings["WebDriverBrowserCapabilities"].ToLower())
{
case "firefox":
capabilities = DesiredCapabilities.Firefox();
break;
case "ie":
capabilities = DesiredCapabilities.InternetExplorer();
break;
case "chrome":
capabilities = DesiredCapabilities.Chrome();
break;
default:
throw new NotImplementedException(string.Format("WebDriverBrowserCapabilities of \"{0}\" is not implemented for {1} mode", ConfigurationManager.AppSettings["WebDriverBrowserCapabilities"].ToLower(), ConfigurationManager.AppSettings["WebDriverMode"].ToLower()));
}
capabilities.IsJavaScriptEnabled = true;
driver = new AdvancedRemoteWebDriver(huburl, capabilities);
break;
default:
throw new NotImplementedException();
}
它應該是「webdriver.gecko.driver」 –
@NisimNaim,謝謝。更新。 –