1.The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see . The latest version can be downloaded from
该问题的错误原因和上面的一样,用IEdriver的时候也需要装插件,去 下载对应的插件版本,然后修改代码如下:
File file = new File("C:/Selenium/iexploredriver.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();
参考来源:
2、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. The latest version can be downloaded from
at com.google.common.base.Preconditions.checkState(Preconditions.java:176) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:75) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:107) at com.example.tests.Selenium2ForChrome.main(Selenium2ForChrome.java:18)出现这个错误的原因是因为谷歌浏览器和selenium不是原生的,需要在谷哥里面装插件,插件下载地址是。
暂时还没解决好。