Webdriver:IE11:处理请求时捕获的I / O异常(java.net.SocketException):软件导致连接中止:recv失败

时间:2014-06-04 13:02:23

标签: selenium selenium-webdriver

使用Selenium WebDriver在win7 IE11中运行我的测试脚本时出现以下错误:

Error:
==============================================================================================
Started InternetExplorerDriver server (64-bit)
2.42.0.0

Listening on port 13127

org.apache.http.impl.client.DefaultRequestDirector tryExecute

INFO: I/O exception (java.net.SocketException) caught when processing request: Software 
caused connection abort: recv failed

org.apache.http.impl.client.DefaultRequestDirector tryExecute

INFO: Retrying request

JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 169 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'blr2261913', ip: '10.177.101.114', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_51'
Session ID: 71972154-3b97-4623-b651-aaa0bb460ffb
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=f
r=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true,
e, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 169 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'blr2261913', ip: '10.177.101.114', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_51'
Session ID: 71972154-3b97-4623-b651-aaa0bb460ffb
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=f
r=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true,
e, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
    at com.thoughtworks.selenium.webdriven.SeleneseCommand.apply(SeleneseCommand.java:44)
    at com.thoughtworks.selenium.webdriven.Timer.run(Timer.java:40)
    at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:143)
    at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:73)
    at com.thoughtworks.selenium.DefaultSelenium.type(DefaultSelenium.java:317)

环境:Windows7-64位,IE11 IEDriver版本:最新版本,即2.42.0 Selenium Server:2.41.0

我已经按照https://code.google.com/p/selenium/wiki/InternetExplorerDriver提到的步骤进行了操作!没有运气!

在网上搜索得足够多,却无法找到解决问题的方法。

任何帮助都将受到高度赞赏。

提前致谢!

1 个答案:

答案 0 :(得分:2)

我不确定这是否直接适用于您的问题,但是当我收到错误时遇到了类似的问题:

Caused by: java.net.SocketException: Connection reset

这引出了我在这里提出的错误:http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7077696

您的错误中recv failed与此错误类似,但有人指出,它更可能是Windows防火墙导致错误而不是错误。一些可能的解决方法(来自网站):

  • 使用-Djava.net.preferIPv4Stack=true

  • 运行
  • 为Java二进制文件添加防火墙例外

  • 或者在防火墙中禁用状态FTP检查 我认为这完成了:netsh advfirewall set global StatefulFTP disable

此处还有一个问题:https://code.google.com/p/selenium/issues/detail?id=6437

这适用于我有更多错误,但它可能适用于你的错误?由于评论#7(来自项目成员)声明 IE11 存在已知问题。

这可能会有所帮助,也可能没有帮助,因为我没有机会测试解决方案,而且我自己并不完全确定!