硒铬驱动程序在发布应用程序后停止工作

时间:2017-06-16 09:15:28

标签: c# selenium selenium-webdriver selenium-chromedriver

我有这个代码。我将chromedriver.exe放入我的解决方案文件夹bin>> debug

ChromeOptions options = new ChromeOptions();
options.AddArgument("--disable-notifications");

IWebDriver driver = new ChromeDriver(options);
driver.Manage().Window.Maximize();

driver.Url = url;

我在调试应用程序时工作正常,但在发布后会引发异常

enter image description here

我该怎么办?它是简单的控制台应用程序

1 个答案:

答案 0 :(得分:1)

您应该尝试较新的ChromeDriver和Selenium版本。我刚刚在Selenium.WebDriver 3.4.0和Selenium.WebDriver.ChromeDriver 2.30.0.1上检查了这段代码

Starting ChromeDriver 2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41) on port 2935
Only local connections are allowed.
Press any key to continue . . .

它适用于调试版和发行版。

相关问题