解决selenium报错:The path to the driver executable must be set by the webdriver.ie.driver system prop...

参考:https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

1.需要在selenium下载专门针对ID的驱动:

解决selenium报错:The path to the driver executable must be set by the webdriver.ie.driver system prop..._第1张图片
image.png

2.需要在实例化之前加入:

System.setProperty("webdriver.ie.driver", "D:\\SETUPS\\IEDriverServer_x64_2.53.1\\IEDriverServer.exe"); // 必须加入
WebDriver driver = new InternetExplorerDriver();

3.需要调整IE浏览器的安全选项,所有区域每一个复选框打上勾;

解决selenium报错:The path to the driver executable must be set by the webdriver.ie.driver system prop..._第2张图片
image.png

4.其他问题,请参考:

http://toolsqa.com/selenium-webdriver/challenges-to-run-selenium-scripts-with-ie-browser/

你可能感兴趣的:(解决selenium报错:The path to the driver executable must be set by the webdriver.ie.driver system prop...)