selenium啟動IE報錯:The path to the driver executable must be set by the webdriver.ie.driver system property;


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 
 
 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 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM