使用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的值 ;

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

 3.利用setCapability进行设置 ;

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

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

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

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

相关文章:

  • 2021-09-01
  • 2022-01-21
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2021-04-27
  • 2021-12-02
  • 2021-10-18
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案