在IE中运行selenium脚本会抛出错误“;只允许本地连接。”;

在IE中运行selenium脚本会抛出错误“;只允许本地连接。”;,selenium,selenium-webdriver,automated-tests,selenium-iedriver,Selenium,Selenium Webdriver,Automated Tests,Selenium Iedriver,我尝试过很多事情,但仍然面临同样的错误。有人能帮忙提出解决方案吗 问题:在IE中运行selenium脚本时,出现以下错误。 设置:我正在使用IE 11和selenium 2.53.0 到目前为止我已经尝试过的事情: 更改了IE安全设置,以便将所有不同的区域设置为安全级别=高 未选中所有区域的“启用保护模式” 我尝试了32位和64位的IEDriverServer.exe 在为驱动程序设置系统属性后,我尝试添加以下代码 更新 我将selenium驱动程序更新为3.0.1,将IEDriver更改为3

我尝试过很多事情,但仍然面临同样的错误。有人能帮忙提出解决方案吗

问题:在IE中运行selenium脚本时,出现以下错误。 设置:我正在使用IE 11和selenium 2.53.0

到目前为止我已经尝试过的事情:

  • 更改了IE安全设置,以便将所有不同的区域设置为安全级别=高
  • 未选中所有区域的“启用保护模式”
  • 我尝试了32位和64位的IEDriverServer.exe
  • 在为驱动程序设置系统属性后,我尝试添加以下代码

  • 更新

    我将selenium驱动程序更新为3.0.1,将IEDriver更改为32位,并出现以下错误

    Started InternetExplorerDriver server (32-bit)
    2.53.1.0
    Listening on port 5420
    Only local connections are allowed
    Sep 26, 2017 12:03:15 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
    Sep 26, 2017 12:03:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Falling back to original OSS JSON Wire Protocol.
    Sep 26, 2017 12:03:30 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Falling back to straight W3C remote end connection
    java.lang.RuntimeException
        at org.testng.internal.TestResult.toString(TestResult.java:245)
        at org.testng.internal.TestResult.toString(TestResult.java:226)
    

    分辨率 对于任何可能感兴趣的人,我已经根据下面的两篇文章解决了我的问题

    基本上 1) 需要修改注册表设置吗 2) 扩展浏览器功能以忽略区域设置和保护模式设置


    使用最新的selenium版本使用最新的selenium版本
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setCapability("ignoreZoomSetting", true);
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    
    Started InternetExplorerDriver server (32-bit)
    2.53.1.0
    Listening on port 5420
    Only local connections are allowed
    Sep 26, 2017 12:03:15 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
    Sep 26, 2017 12:03:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Falling back to original OSS JSON Wire Protocol.
    Sep 26, 2017 12:03:30 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Falling back to straight W3C remote end connection
    java.lang.RuntimeException
        at org.testng.internal.TestResult.toString(TestResult.java:245)
        at org.testng.internal.TestResult.toString(TestResult.java:226)