How to fix [1573451709.039][WARNING]: Timed out connecting to Chrome, retrying... while using chrome version 78 and chrome driver version 78.0.3904.70

Neha Gupta picture Neha Gupta · Nov 11, 2019 · Viewed 12.7k times · Source

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...

How can I fix it?

Answer

DebanjanB picture DebanjanB · Nov 11, 2019

This error message...

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...

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


Analysis

The first log message:

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

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

You can find a detailed discussion in How do I protect the ports that chromedriver use?


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.


Solution

Ensure that:

  • 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.