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

  • 相关阅读:
    perl 实现ascall 码转换
    perl 利用管道读取压缩文件内容
    perl 字符串比较操作符
    perl chomp 函数的真正作用
    RSQLite 操作sqlite数据库
    R 中的do.call 函数
    JavaMail发送和接收邮件API(详解)
    POP3_使用SSL链接邮箱并获取邮件
    MySql_delete同时删除多表相关联记录
    mybatis_mybatis写mapper文件注意事项
  • 原文地址:https://www.cnblogs.com/testway/p/6037774.html
Copyright © 2020-2023  润新知