1.selenium啟動IE報錯:The path to the driver executable must be set by the webdriver.ie.driver system property;
A.具體的報錯內容是:
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the
webdriver.ie.driver system property; for more information, see
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from
http://selenium-release.storage.googleapis.com/index.html
webdriver.ie.driver system property; for more information, see
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from
http://selenium-release.storage.googleapis.com/index.html
B.代碼具體的寫法:
C.解決方法是:
需要先使用System.setProperty 去設置IE 的 IEDriver 路徑,再去創建 IEDriver
具體是代碼演示:
System.setProperty("webdriver.ie.driver", "D:\\selenium\\IEDriverServer.exe");
InternetExplorerDriver driver = new InternetExplorerDriver();
其中:D:\\selenium\\IEDriverServer.exe" 為你存放的IEDriver 的路徑
以上解決方法參考了:http://www.cnblogs.com/xmmc/p/7634499.html
