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-2025 CODEPRJ.COM