解决selenium 启动ie浏览器报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones

启动ie代码:

         System.setProperty("webdriver.ie.driver", "bin/IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
String url = "http://www.baidu.com";
driver.get(url);

启动ie报错:

Started InternetExplorerDriver server (64-bit)
2.44.0.0
Listening on port 10375
FAILED: fff2
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.50 seconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'FC000329PC1', ip: '169.254.242.52', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:164)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)

解决办法:

internet 选项,进入安全标签,分别点击internet ,本地intranet,受信任的站点,受限制的站点,四个设置,全部去掉勾选“启用保护模式”  或者全部勾选“启用保护模式”,即保持这四个设置一致,要么全部勾选,要么全部去掉勾选,就可以启动ie浏览器了

解决selenium 启动ie浏览器报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones

上一篇:ArcGIS Server开发教程系列(3)切片


下一篇:table头部、尾部固定;中间内容定高自适应滚动