如何修复 [1573451709.039][警告]:连接到 Chrome 时超时,正在重试...同时使用 chrome 版本 78 和 chrome 驱动程序版本 78.0.3904.70

我的 Chrome 浏览器已更新到版本 78,当我尝试执行任何自动化代码时,它会显示错误

My Chrome browser is updated to version 78 and when I tried to execute any code of automation, it shows the error

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...
Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[1573451709.039][WARNING]: Timed out connecting to Chrome, retrying...

我该如何解决?

推荐答案

这个错误信息...

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...
Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[1573451709.039][WARNING]: Timed out connecting to Chrome, retrying...

...暗示 ChromeDriver 无法启动/生成新的 WebBrowser 即 Chrome 浏览器 会话.

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

第一条日志消息:

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

是使用 ChromeDriver 本质上是信息丰富的.

is part of the startup log when using ChromeDriver and is informative in nature.

您可以在 中找到详细讨论如何保护 chromedriver 使用的端口?

<小时>

以下日志消息:


The following log message:

[1573451703.668][WARNING]: Timed out connecting to Chrome, retrying...

表示您使用的二进制文件版本之间存在一些不兼容.

indicates there are some incompatibility between the version of the binaries you are using.

确保:

  • JDK 升级到当前级别 JDK 8u222.
  • Selenium 已升级到当前级别版本 3.141.59.
  • ChromeDriver 已更新为当前 ChromeDriver v78.0 级别.
  • Chrome 已更新至当前 Chrome 版本 78.0 级别.(根据 ChromeDriver v78.0 发行说明)
  • 清理你的项目工作区通过你的IDE和重建你的项目只需要依赖.
  • (仅限 Windows 操作系统)使用 CCleaner 在执行 Test Suite 之前和之后清除所有操作系统杂务的工具.
  • (仅限 LinuxOS)在执行 Test Suite 之前和之后释放和释放 Ubuntu/Linux Mint 中未使用/缓存的内存.
  • 如果您的基本 Web 客户端 版本太旧,请卸载它并安装最新的 GA 和发布版本的 Web 客户端.
  • 进行一次系统重启.
  • 以 非 root 用户身份执行您的 @Test.
  • 总是在 tearDown(){} 方法中调用 driver.quit() 来关闭 &优雅地销毁 WebDriver 和 Web Client 实例.
  • JDK is upgraded to current levels JDK 8u222.
  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v78.0 level.
  • Chrome is updated to current Chrome Version 78.0 level. (as per ChromeDriver v78.0 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • (WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
  • (LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

相关文章