我得到一個錯誤:硒。 IEDriverServer.exe不存在?
文件功能[BrowserName =,IsJavaScriptEnabled =假,平臺=任意版本=] \ IEDriverServer.exe不存在。駕駛者可以在http://code.google.com/p/selenium/downloads/list'
我應該做些什麼來解決這個錯誤,因爲我真的無法找到信息....
我得到一個錯誤:硒。 IEDriverServer.exe不存在?
文件功能[BrowserName =,IsJavaScriptEnabled =假,平臺=任意版本=] \ IEDriverServer.exe不存在。駕駛者可以在http://code.google.com/p/selenium/downloads/list'
我應該做些什麼來解決這個錯誤,因爲我真的無法找到信息....
除非你正在構建從源硒項目進行下載,或者是使用.NET綁定並在InternetExplorerOptions
類中設置了特定選項,則不應該看到此消息。當前的源代碼在這個特定的區域是易變的,因爲該項目目前正在爲IE驅動程序使用獨立的可執行服務器,類似於Chrome驅動程序目前的情況。如果您從源代碼構建或,或者對使用此新功能感興趣,則應從異常消息中指定的URL下載獨立的IE驅動程序服務器可執行文件。
下載IEDriver.exe指定網址
http://code.google.com/p/selenium/downloads/list
假設的exe文件保存在E:\ IEdriver.exe。
在Selenium中,你必須設置IEDriver的屬性,因爲Selenium只有firefox驅動程序。
設置系統屬性,然後調用IEDriver。
WebDriver driver;
System.setProperty("webdriver.ie.driver", "E:\\IEdriver.exe");
//Selenium will not support single slash, so we are providing double slash in path.
driver = new InternetExplorerDriver();
// By this it will call the IEDriver and execute
由於
一個例子共享:
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver", "D:\\selenium\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("www.google.com");
driver.findElement(By.id("gbqfq")).sendKeys("abc");
driver.close();
}
}
是的,這是。感謝 –
請參閱http://stackoverflow.com/q/11010317/743瞭解如何使用它的示例 –