Cannot find firefox binary in PATH. Make sure firefox is installed.

使用selenium报找不到浏览器安装路径错误

解决办法如下:

1.重新安装firefox在默认路径下; 

OS Expected Location of Firefox
Linux firefox (found using "which")
Mac /Applications/Firefox.app/Contents/MacOS/firefox
Windows %PROGRAMFILES%\Mozilla Firefox\firefox.exe


 

2.直接用System.setProperty方法设置webdriver.firefox.bin的值 ;

 3.利用setCapability进行设置 ;

4.用FirefoxBinary类和public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile)这个构造方法;

猜你喜欢

转载自blog.csdn.net/weixin_32418175/article/details/82391518