问题一:

java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

解决办法:

方法一:将chromedriver.exe的路径添加到环境变量,添加之后需要重启eclipse


方法二:在代码中添加System.setProperty("webdriver.chrome.driver", "D:/driver/chromedriver.exe");

 再次运行代码,发现问题已解决

 

问题二:

 org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-34JKHKC', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_231'
Driver info: driver.version: FirefoxDriver

解决办法:将Firefox的安装路径添加到环境变量D:\Program Files (x86)\Mozilla Firefox\,添加之后需要重启eclipse



再次运行代码发现问题已解决:

 

 

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐