雖然從硒的webdriver以下錯誤啓動IE被示出:在螺紋無法從硒的webdriver啓動IE /鉻
異常「主要」 java.lang.IllegalStateException:路徑 到驅動器可執行文件必須由webdriver.ie.driver系統 屬性設置。在 com.google.common.base.Preconditions.checkState(Preconditions.java:177) 在 org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105) 在 org.openqa。 selenium.ie.InternetExplorerDriverService.access $ 1(InternetExplorerDriverService.java:1) 在 org.openqa.selenium.ie.InternetExplorerDriverService $ Builder.build(InternetExplorerDriverService.java:230) 在 org.openqa.selenium.ie.InternetExplorerDriver .setupService(InternetExplorerDriver.java:263) 在 org.openqa.selenium.ie.InternetExplorerDriver。(InternetExplorerDriver.java:182) 在 org.openqa.seleniu 。m.ie.InternetExplorerDriver(InternetExplorerDriver.java:155)使用
代碼:
public class Browser {
public static void main(String[] args) {
WebDriver obj = new InternetExplorerDriver();
System.getProperty("webdriver.ie.driver", "D:\\Eclipse Workspace\\Multi Browser\\IEDriverServer.exe");
obj.get("http://www.google.com/");
obj.close();
}
檢查瀏覽器版本;那是25+嗎?此外,您的驅動器應正確位於C://chromedriver.exe –
是其33.xx.所以決議是降級鉻?項目文件夾中添加了Chromedriver,所以沒有問題。 –
是嘗試降級及覈對有關的路徑提到相同 –