Selenium:无法调用IE,报错java.lang.IllegalStateException

在使用Selenium调用IE时报错,java.lang.IllegalStateException:the path to the driver executable must be set by the webdriver system property;for more information,see https://github.....

先尝试利用和chrome一样解决方案,设置IEDriverServer到环境变量path中,未果。

后来在代码中指定webdriver路径解决,具体如下

...
File file = new File("d:/Webdriver/IEDriverServer,exe");
System.setProperty("webdriver.ie.driver",file.getAbsolutePath());
WebDriver driver = new InternetExolorerDriver();
...

 

你可能感兴趣的:(Selenium)