WebDriverError: disconnected: unable to connect to renderer
Asked Answered
J

5

36

Meta -

OS: OSX 10.12.6 (16G29)

~./node_modules/chromedriver/bin/chromedriver  -v
ChromeDriver 2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061)

~ $ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7/Contents/Home

~ $ node -v
v6.11.2

Browser:

Chrome Version 62.0.3202.62 (Official Build) (64-bit)

Browser Version:

62.0.3202.62 (Official Build) (64-bit)

Expected Behavior -

A Chrome session should start and the script should execute till the end

Actual Behavior -

The browser is started but the script immedialy crashes.

Code:

> [email protected] selenium-local /Users/Georgios/Development/rocket-internet/ucb-client
> node test/automation-tests/testcases/happy-path/Local_Guest_Cash.js

/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/promise.js:2634
        throw error;
        ^

WebDriverError: disconnected: unable to connect to renderer
  (Session info: chrome=62.0.3202.62)
  (Driver info: chromedriver=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X 10.12.6 x86_64)
    at WebDriverError (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/error.js:27:5)
    at Object.checkLegacyResponse (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/error.js:529:15)
    at parseHttpResponse (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/http.js:441:30)
    at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.manage().window().setSize(1280, 720)
    at thenableWebDriverProxy.schedule (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
    at Window.setSize (/Users/Georgios/Development/rocket-internet/ucb-client/node_modules/selenium-webdriver/lib/webdriver.js:1677:25)
    at Object.<anonymous> (/Users/Georgios/Development/rocket-internet/ucb-client/test/automation-tests/testcases/happy-path/Local_Guest_Cash.js:8:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
Actual script (beginning)

require('chromedriver');
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder().forBrowser('chrome').build();
var timeout = 15000;
Jackhammer answered 18/10, 2017 at 10:3 Comment(0)
E
32

You are using the chromediver 2.32 and in the release notes there is written that the support is for Chrome v59-61

As browser you have:

Chrome Version 62.0.3202.62 (Official Build) (64-bit) 

So, from ChromeDriver, you should use the 2.33

Erector answered 18/10, 2017 at 10:15 Comment(6)
That's right! Download latest version from chromedriver.storage.googleapis.com/index.html?path=2.33 and bug will disapeare.Rodman
just to note that it's not a clean cut, some things are not working (backward compatibility wise), but it seems minor for now (around Window positions which wasn't much of a use anyways).Reserved
Really thanks, this solved my problem. I was running an old version of chromedriver and Chrome 62Precancel
FYI, this is specifically an instance of bugs.chromium.org/p/chromedriver/issues/detail?id=1918Dorthydortmund
npm install -g chromedriver on Chrome 65 and chromedriver v. 2.31 (which then updated to v. 2.36) solved it for me!Flightless
I'm using latest chrome version 80 for Chrome Browser 80 but ,for me it is still displaying same error message...Subservient
P
44

I had similar error. But versions were matching: I was using Chrome 65 with driver version 2.38.

I spent long time, trying to understand the issue. At the end, found that it was caused by empty /etc/hosts file. Apparently Chrome communicates via localhost, and if such entry missing in /etc/hosts - it will crash.

So, make sure, it has entry like this:

127.0.0.1 localhost

Photocopier answered 23/4, 2018 at 15:55 Comment(7)
I had this problem with Mac OS X 10.13.6, Selenium 3.13.0, Chromedriver 2.41, and Chrome 67. Adding the line 127.0.0.1 localhost loopback to /etc/hosts fixed it right up.Expressman
I spent a couple nights looking into this issue and a lot of the solutions instruct you to make sure your versions are all up to date/in sync: selenium, chrome, chromedriver ... if your versions are all in sync and updated then this is what you need to do. This worked for me editing the /etc/hosts file with TOB's code comment.Perhaps
How on EARTH did you find that? My god, I wasted an entire day.Sorbitol
That solves my problem. I checked and all versions were fine but now I can recall, I changed the localhost entry to another host on some day. Changing to 127.0.0.1 localhost worked. I wasted two days figuring out. Thank you!Toilworn
going by the comments above this saved me a fair bit of time as well.Spectroscopy
You just saved me an hour :] I will petition to have the error improved.Gerge
I've changed as per above but still for me coming as "[1581500745.657][WARNING]: Timed out connecting to Chrome, giving up." ,can any one help meSubservient
E
32

You are using the chromediver 2.32 and in the release notes there is written that the support is for Chrome v59-61

As browser you have:

Chrome Version 62.0.3202.62 (Official Build) (64-bit) 

So, from ChromeDriver, you should use the 2.33

Erector answered 18/10, 2017 at 10:15 Comment(6)
That's right! Download latest version from chromedriver.storage.googleapis.com/index.html?path=2.33 and bug will disapeare.Rodman
just to note that it's not a clean cut, some things are not working (backward compatibility wise), but it seems minor for now (around Window positions which wasn't much of a use anyways).Reserved
Really thanks, this solved my problem. I was running an old version of chromedriver and Chrome 62Precancel
FYI, this is specifically an instance of bugs.chromium.org/p/chromedriver/issues/detail?id=1918Dorthydortmund
npm install -g chromedriver on Chrome 65 and chromedriver v. 2.31 (which then updated to v. 2.36) solved it for me!Flightless
I'm using latest chrome version 80 for Chrome Browser 80 but ,for me it is still displaying same error message...Subservient
P
2

IT is because driver is not closed and you try run again.
Try to reboot or change port id.
options.addArguments("--remote-debugging-port=9230")
You can change this port.
Thanks

Peavy answered 30/11, 2023 at 1:25 Comment(1)
Instead of rebooting: killing the respective driver processes might also work.Blocked
S
1

Here's an brew addendum to @davide-patti solution. :)

When I was getting the error unable to connect to renderer, I learned from @davide-patti that I was using an older version of chromedriver, v2.32. But I was unable to upgrade my chromedriver with homebrew, as I received continually: No available formula with the name "chromedriver".

This article helped me a lot to upgrade to v2.33+.

About: Error: No available formula with the name "chromedriver" https://github.com/Homebrew/brew/issues/4089

Staggard answered 23/4, 2018 at 23:21 Comment(0)
H
1

It causes because page took long time to load , you need add additional line to your script

System.setProperty("webdriver.chrome.driver","E:\\selenium\\chromedriver_2.41\\chromedriver.exe");
//mention the below chrome option to solve timeout exception issue
ChromeOptions options = new ChromeOptions();
options.setPageLoadStrategy(PageLoadStrategy.NONE);
// Instantiate the chrome driver
driver = new ChromeDriver(options);
Heartburn answered 25/8, 2018 at 10:53 Comment(1)
Running headful chrome in AWS lambda was giving me this error. Setting the page load strategy fixed the error. Thanks.Haustellum

© 2022 - 2024 — McMap. All rights reserved.