UnreachableBrowserException:与远程浏览器通信时出错。它可能已死,而Command无法完全关闭。强行摧毁

时间:2018-10-12 11:42:14

标签: selenium selenium-webdriver webdriver selenium-chromedriver teardown

当我执行测试套件时,tearDown()方法随机失败,并且它下面的所有测试都被跳过。以下是详细信息。屏幕快照已安装。

TESTNG跟踪:

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: '2.46.0', revision: '61506a4624b13675f24581e453592342b7485d71', time: '2015-06-04 10:22:50' System info: host: 'W7-VDI-WDW704', ip: '10.207.15.35', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_152' Driver info: driver.version: RemoteWebDriver

日志:

INFO: Command failed to close cleanly. Destroying forcefully (v2). org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@12c7a01b 
Oct 09, 2018 4:03:01 PM org.openqa.selenium.os.ProcessUtils killWinProcess WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
org.openqa.selenium.os.ProcessUtils$ProcessStillAliveException: Timeout waiting for process to die at org.openqa.selenium.os.ProcessUtils.waitForProcessDeath(ProcessUtils.java:67) at (...)

Suite Total tests run: 196, Failures: 4, Skips: 175 Configuration Failures: 176, Skips: 175

enter image description here

  • Chrome版本:69.0.3497.100版
  • Chromedriver:ChromeDriver 2.42 **

1 个答案:

答案 0 :(得分:0)

此错误消息...

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died
.
INFO: Command failed to close cleanly. Destroying forcefully (v2). org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@12c7a01b Oct 09, 2018 4:03:01 PM org.openqa.selenium.os.ProcessUtils killWinProcess WARNING: Process refused to die after 10 seconds, and couldn't taskkill it

...表示 ChromeDriver 无法杀死 WebBrowser ,即 RemoteWebDriver

您的主要问题是所使用的二进制版本之间的不兼容性

根据讨论On Windows, RemoteWebDriver.quit() is always destroying forcefully?,此问题在 Selenium v​​2.45.0 之前的版本中很明显,其中@ timja2在其comment中提到:

  

它有望在Windows上更加强大地摧毁

此修补程序已通过commit 7a5e890进行了合并,预计可从 Selenium v​​2.53.1 开始使用。

解决方案

  • 升级到最低版本2.53.1 或当前的Version 3.14.0水平。