2
我有此代码。我把chromedriver.exe
在我的解决方案文件夹仓>>调试硒铬合金驱动程序在发布应用程序后停止工作
ChromeOptions options = new ChromeOptions();
options.AddArgument("--disable-notifications");
IWebDriver driver = new ChromeDriver(options);
driver.Manage().Window.Maximize();
driver.Url = url;
当我调试应用程序它的工作原理确定,但在发布后它抛出一个异常
我能做些什么?这是简单的控制台应用程序
你已经使用nuget安装了chrome驱动程序? – gsiradze
发布应用程序后,它会抛出该错误:未处理的异常:OpenQA.Selenium.DriverServiceNotFoundException:chromedriver.exe文件不存在于当前目录或PATH环境变量的目录中。 – gsiradze
是的,当然。这里是页面:[NuGet包 - Selenium WebDriver ChromeDriver](https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/)。然后,我将包文件夹**中的文件'chromedriver.exe'作为链接**添加到项目中,并将文件的属性设置为“Copy if newer”,从而在构建时自动将驱动程序复制到您的箱中。 –