org.openqa.selenium.WebDriverException : disconnected: not connected to DevTools error using ChromeDriver Chrome using Selenium and Java… here is a solution to the problem.
org.openqa.selenium.WebDriverException : disconnected: not connected to DevTools error using ChromeDriver Chrome using Selenium and Java
I see the following error, disconnected between browsers. It only happens on chrome. The version of Selenium I’m using is:
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
Error stack trace:
[1579632222.785][SEVERE]: Unable to receive message from renderer
org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
(Session info: chrome=79.0.3945.117)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'MBP15-PBJGH8.8x8.com', ip: 'fe80:0:0:0:1846:114d:10a6:bf26%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_201'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.117, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /var/ folders/mz/2_llwtkx31d...}, goog:chromeOptions: {debuggerAddress: localhost:54446}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform : MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 3577826ba5ac2d089a34e17f9aa987c9
Solution
This error message….
org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
(Session info: chrome=79.0.3945.117)
.
.
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.117, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /var/ folders/mz/2_llwtkx31d...}, goog:chromeOptions: {debuggerAddress: localhost:54446}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform : MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
… Implying that the ChromeDriver cannot start/generate a new browsing context, i.e. Chrome browser session.
Your main problem is incompatibilities between the binary versions you use, as follows:
- You are using chromedriver=78.0
- The release notes for chromedriver=78.0 explicitly mention the following:
Supports Chrome v78
- You are using chrome=79.0
- the release notes for ChromeDriver v79.0 explicitly mention the following:
Supports Chrome 79
So there is a clear mismatch between ChromeDriver v78.0 and Chrome v79.0
Solution
Make sure:
- ChromeDriver has been updated to the current ChromeDriver V79.0.3945.36 level.
- has been updated to the current Chrome version 79.0 level. (according to ChromeDriver v79.0 release notes
- Clean up your project workspace, go through your IDE and rebuild your project, using only the required dependencies.
- If your base Web Client version is too old, uninstall it and install the latest GA and release versions of Web Client.
- System reboot.
- Perform your
@Test
as a non-root user. - Always call
driver.quit
() in thetearDown(){}
method to close and destroy WebDriver and Web Client instances gracefully.
Chrome
).