【发布时间】:2016-07-26 12:47:44
【问题描述】:
【问题讨论】:
【问题讨论】:
发生这种情况是因为 selenium 无法检测到您的 Firefox 的位置。你需要设置System.setProperty来协助selenium了解你系统中firefox的位置
根据https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver,您必须设置一个属性来设置二进制路径:
webdriver.firefox.bin
对于我的系统,我在以下位置安装了 Firefox:-
System.setProperty("webdriver.firefox.bin","/Applications/Firefox20.0");
WebDriver driver = new FirefoxDriver();
一些系统的位置如下:-
System.setProperty("webdriver.firefox.bin","/Applications/Firefox.app/Contents/MacOS/firefox-bin");
或
有一些补充的问题,请参阅下面的链接:-
Failed to connect to binary FirefoxBinary with Selenium in Maven
希望对你有帮助:)
【讨论】: