为了账号安全,请及时绑定邮箱和手机立即绑定

启动谷歌浏览器报错

      WebDriver driver ;

          System.setProperty("Webdriver.chrom.driver","C:\\Program Files\\chromedriver_win32\\chromedriver.exe");

          driver = new ChromeDriver();

          String testUrl="http://www.baidu.com";

          driver.get("testUrl");

          driver.quit();

Exception in thread "main" 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

at com.google.common.base.Preconditions.checkState(Preconditions.java:197)

at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)

at org.openqa.selenium.chrome.ChromeDriverService.access$0(ChromeDriverService.java:1)

at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)

at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:290)

at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)

at commSelenium.Demoselenium1.main(Demoselenium1.java:11)


正在回答

2 回答

我也是这样楼主解决了嘛

0 回复 有任何疑惑可以回复我~

可能是driver的版本问题,换个别的版本试一下

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

启动谷歌浏览器报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信