我尝试过很多东西,但仍面临同样的错误。有人可以帮忙建议解决方案吗?
问题:在IE中运行selenium脚本时,我收到以下错误。 设置:我正在使用IE 11和selenium 2.53.0
Started InternetExplorerDriver server (64-bit)
2.53.1.0
Listening on port 10402
Only local connections are allowed
到目前为止我尝试过的事情:
- 更改了IE安全设置,以便将所有不同的区域设置为安全级别=高
- 未选中“为所有区域启用保护模式”
- 我尝试了32位和64位IEDriverServer.exe
- 我在为驱动程序设置系统属性后尝试添加以下代码
醇>
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);
更新
我将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)扩展浏览器功能以忽略区域设置和保护模式设置