zoukankan      html  css  js  c++  java
  • 解决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浏览器了

  • 相关阅读:
    BNUOJ 19792 Airport Express
    Poor Hanamichi
    BNUOJ 1206 A Plug for UNIX
    HDU 3507 Print Article
    一个程序猿试用有道云笔记VIP功能体验
    Cloud Foundry Session Affinity(Sticky Session)的实现
    SAP成都研究院廖婧:SAP C4C社交媒体集成概述
    SAP订单编排和流程增强概述
    在Kubernetes上运行SAP UI5应用(上)
    Docker入门系列之三:如何将dockerfile制作好的镜像发布到Docker hub上
  • 原文地址:https://www.cnblogs.com/testway/p/6037774.html
Copyright © 2011-2022 走看看