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浏览器了

  • 相关阅读:
    zoj 2972
    图像切割之(五)活动轮廓模型之Snake模型简单介绍
    使用和制作patch文件
    一步一步写算法(之洗牌算法)
    第3讲 数码管显示
    Oracle 11g client的安装和配置。
    StringTokenizer类的使用
    BDB (Berkeley DB)数据库简单介绍(转载)
    关于MSHTML
    C语言sizeofkeyword
  • 原文地址:https://www.cnblogs.com/testway/p/6037774.html
Copyright © 2011-2022 走看看