这是我的问题:使用 chrome 运行 Selenium 测试。
我这样做:
ChromeOptions options = new ChromeOptions();
options.setBinary("/Applications/Google/Google Chrome.app");
System.setProperty("webdriver.chrome.driver", "/Users/Blabla/Documents/lib/chrome/chromedriver");
当我这样做时
mvn test
,我收到此错误: unknown error: cannot find Chrome binary
最佳答案
根据ChromeDriver Capabilities docs :
Path to the Chrome executable to use (on Mac OS X, this should be the actual binary, not just the app. e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
因此,您需要在 Finder 中找到您的应用程序并执行“显示包内容”
关于google-chrome - ChromeDriver - 未知错误 : cannot find Chrome binary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35181740/