Visual Studio Mac 无法识别路径中的 Chrome 驱动程序

Visual Studio Mac Doesn't Recognize Chrome Driver in Path

我不熟悉将 C# 用于 Selenium WebDriver。我的背景是在 Windows 上使用 Java 和 Python。所以我也是 OSX、Visual Studio 和 C# 的新手。我已经使用 .NET 应用程序控制台启动了一个项目,将 Selenium 包添加到 NuGet,并将 downloaded/added ChromeDriver 添加到项目路径。我很困惑为什么会收到此错误。

OpenQA.Selenium.DriverServiceNotFoundException has been thrown

"The chromedriver file does not exist in the current directory or in a
directory on the PATH environment variable. The driver can be 
downloaded at https://chromedriver.storage.googleapis.com/
index.html."

与 Visual Studio 7.5(内部版本 1254) macOS High Sierra 版本 10.13.4

我也将 Chrome 驱动程序路径添加到 bash_profile。

感谢任何帮助。如果需要更多信息,我会毫不犹豫地提供 :) 谢谢!

IDE

Path

您必须将 ChromeDriver.exe 文件放入 bin/debug 文件夹。

更多安装说明位于 https://www.kenst.com/2015/03/installing-chromedriver-on-mac-osx/

我在尝试将 Visual Studio 中的 $PATH 用于 Mac 时遇到了同样的问题。我的 $PATH 是在 ~/.bash_profile 中配置的。我能够使用来自 Rider IDE 的 chromedriver 只是很好地阅读 $PATH 但不是 Visual Studio 用于 Mac。重新启动 VS 并重新启动机器但没有运气。

最后,我不得不将 chromedriver 可执行文件放入解决方案 bin/TEST 文件夹中,因为我是 运行 测试配置。因此,如果 bin/debug 对您不起作用,您可以尝试 bin/DEVbin/TEST 等...