Selenium Timed out receiving message from renderer

Google ChromeSeleniumSelenium Chromedriver

Google Chrome Problem Overview


After Chrome released their newest version yesterday (64.0.3282), I am now receiving this error rather sporadically:

> Timed out receiving message from renderer: 600.000

I'm running about 2,000 selenium tests within a docker container and I see this failure at a rate of about 1 in 100. There are no reproducible steps as far as I can tell- the tests that fail are different with each iteration. I updated to the newest Chromedriver (2.35), but that didn't seem to have any effect. I was previously using Selenium 2.41, but have updated to the newest version (3.8.1) hoping that it might help... it did not. I'm completely at a loss as to why this might be occurring. Has anyone else noticed this? Is it possibly a bug with Chrome's newest release?

Thank you in advance for any help you may be able to provide.

Google Chrome Solutions


Solution 1 - Google Chrome

Check for JS Runtime

First verify you aren't executing / eval()ing a lot of javascript. That can cause a timeout.

Check Version Compatibility

First, verify your versions of:

  • Selenium
  • JDK
  • ChromeDriver
  • Chrome

are all compatible. Good luck doing this because there is no single place that documents it, AND selenium software isn't smart enough to do a quick check (it should)

Check Driver Initialization

Add this cryptic block of code, what I like to call the "Ever Growing List of Useless Arguments" chromedriver requires

up to date from every issue ever reported on stack overflow as of: September 2018

// ChromeDriver is just AWFUL because every version or two it breaks unless you pass cryptic arguments
//AGRESSIVE: options.setPageLoadStrategy(PageLoadStrategy.NONE); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
options.addArguments("start-maximized"); // https://stackoverflow.com/a/26283818/1689770
options.addArguments("enable-automation"); // https://stackoverflow.com/a/43840128/1689770
options.addArguments("--headless"); // only if you are ACTUALLY running headless
options.addArguments("--no-sandbox"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-dev-shm-usage"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-browser-side-navigation"); //https://stackoverflow.com/a/49123152/1689770
options.addArguments("--disable-gpu"); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
driver = new ChromeDriver(options);

//This option was deprecated, see https://sqa.stackexchange.com/questions/32444/how-to-disable-infobar-from-chrome
//options.addArguments("--disable-infobars"); //https://stackoverflow.com/a/43840128/1689770

Sources:

Solution 2 - Google Chrome

I had this issue today, with Chrome: Version 73.0.3683.86 (Official Build) (64-bit). For me it was failing on the timeouts on Jenkins builds, and was fine locally, see the following Chrome options that helped me to overcome that issue (ChromeDriver at this time: version - 73.0.3683.68):

ChromeOptions options = new ChromeOptions();
options.addArguments("enable-automation");
options.addArguments("--headless");
options.addArguments("--window-size=1920,1080");
options.addArguments("--no-sandbox");
options.addArguments("--disable-extensions");
options.addArguments("--dns-prefetch-disable");
options.addArguments("--disable-gpu");
options.setPageLoadStrategy(PageLoadStrategy.NORMAL);

Solution 3 - Google Chrome

It looks like there was an issue with the newest Chrome release. Without the disable-gpu Chromeoption set, the renderer will occasionally timeout. The workaround until Google fixes this (if they do fix it at all) is to add the --disable-gpu attribute to the ChromeOptions.

EDIT: This reduced the frequency of occurrences, but it is still happening.

Solution 4 - Google Chrome

v93 broken my code, i tried so many option finally, following code is working fine for me.

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--disable-gpu");
WebDriverManager.chromedriver().forceDownload().setup();
webDriver = new ChromeDriver(chromeOptions);

Solution 5 - Google Chrome

Root cause: Whenever you are loading some page with the help of selenium driver,  then driver script wait till page is completely loaded. But sometime webdriver takes more time to load page, in that case you will see TimeoutException exception in your console.

Solution: When Page Loading takes too much time for wait so we will wait for the DOMContentLoaded event with page load strategy. This page load strategy is called Eager. A small definition of available all 3 pageload strategies.

1. normal: This strategy causes Selenium to wait for the full page loading (html content and sub resources downloaded and parsed).

2. eager : This strategy causes Selenium to wait for the DOMContentLoaded event (html content downloaded and parsed only).

3. none : This strategy causes Selenium to return immediately after the initial page content is fully received (html content downloaded).

NOTE : By default, when Selenium loads a page, it follows the normal pageLoadStrategy.

Code snippet without using Pageload strategy (Or Normal as used by selenium by default)

System.setProperty("webdriver.chrome.driver", "C:\\Users\\...\\LatestDriver\\chromedriver.exe");   
WebDriver driver=new ChromeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
WebDriverWait wait = new WebDriverWait(driver, 20);
WebElement el = wait.until(ExpectedConditions.elementToBeClickable(By.name("q")));
el.click();
List <WebElement> allLinks = driver.findElements(By.tagName("a"));
System.out.println(allLinks.size());
driver.quit();

Console Output:

> Starting ChromeDriver 80.0.3987.16 > (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}) > on port 41540 Only local connections are allowed. Please protect ports > used by ChromeDriver and related test frameworks to prevent access by > malicious code. Feb 11, 2020 10:22:12 AM > org.openqa.selenium.remote.ProtocolHandshake createSession INFO: > Detected dialect: W3C [1581412933.937][SEVERE]: Timed out receiving > message from renderer: 0.100 [1581412934.066][SEVERE]: Timed out > receiving message from renderer: 0.100 [1581412934.168][SEVERE]: Timed > out receiving message from renderer: 0.100 [1581412934.360][SEVERE]: > Timed out receiving message from renderer: 0.100 > [1581412934.461][SEVERE]: Timed out receiving message from renderer: > 0.100 [1581412934.618][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.719][SEVERE]: Timed out receiving message > from renderer: 0.100 [1581412934.820][SEVERE]: Timed out receiving > message from renderer: 0.100 [1581412934.922][SEVERE]: Timed out > receiving message from renderer: 0.100 [1581412935.097][SEVERE]: Timed > out receiving message from renderer: 0.100 21

With PageLoad Strategy - Eager - Code Snippet:

System.setProperty("webdriver.chrome.driver", "C:\\Users\\...\\LatestDriver\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setPageLoadStrategy(PageLoadStrategy.EAGER);
WebDriver driver=new ChromeDriver(options);
driver.get("http://www.google.com");
driver.manage().window().maximize();
WebDriverWait wait = new WebDriverWait(driver, 20);
WebElement el = wait.until(ExpectedConditions.elementToBeClickable(By.name("q")));
el.click();
List <WebElement> allLinks = driver.findElements(By.tagName("a"));
System.out.println(allLinks.size());
driver.quit();

Console Output:

> Starting ChromeDriver 80.0.3987.16 > (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}) > on port 1175 Only local connections are allowed. Please protect ports > used by ChromeDriver and related test frameworks to prevent access by > malicious code. Feb 11, 2020 10:29:05 AM > org.openqa.selenium.remote.ProtocolHandshake createSession INFO: > Detected dialect: W3C 21

Solution 6 - Google Chrome

In our case, we found the problem was a performance issue because the screenshot taken was huge but it happened because we realized the screenshot resolution of the screenshots created by Chrome was double than the specified in code for calling the chromedriver, for example, if we specified width 1024px and height 2000px in the screenshot, it was creating an image of 2048px width and 4000px height so that is why was taking too much for rendering and the timeout breaks the process, in cases when the process finished (after long wait) it was creating a heavy screenshot images. We found it was an option (problem) of Chrome for supporting retina devices which increase the resolution of the screenshot, so, we forced using a flag to deactivate the option and render the original resolution configured and it works well, taking between 8 seconds to 13 seconds to create the screenshot (depending on the content of the page) and the image size is less than at the begenning. This is the flag into the ChromeOptions object:

options.addArguments("--force-device-scale-factor=1");

Solution 7 - Google Chrome

First of all the other answers have been of great help and as everyone, I too have been struggling to make the chrome webdriver work, using the endless list of arguments that it requires. Below are some of my observations after breaking my head over this for a while:

The Timeout error is received due to manually setting the timeout of the webdriver. driver.set_page_load_timeout(30) We can skip this line and resolve the error, but then the webdriver would run indefinitely if the website keeps on loading and hence is always recommended to use.

First of all, make sure the chrome driver and chrome are on the stable recent cross-compatible versions. (most common error) Since I use docker for my use-case, I let my code handle to download the latest stable versions of both chrome and chromedriver during docker build, to rule out compatibility issues. Refer here for a simple explanation of the same.

Secondly, the below arguments helped me run the chromedriver as headless without any issues. I'm surprised the arguments aren't well documented anywhere. Found good documentation here

--no-sandbox
window-size=1920,1080
--ignore-certificate-errors
--ignore-ssl-errors
--disable-dev-shm-usage
--disable-gpu")
--log-level=3")
enable-features=NetworkServiceInProcess
disable-features=NetworkService

And thirdly, after the above configurations, the issue I faced was it was working for me in a docker container when run on windows, but failed to run on Linux/Kubernetes. The reason being, for Linux, it requires a PyVirtualDisplay to work. Hence adding this below piece of code before using the webdriver resolved all issues.

from pyvirtualdisplay import Display
display = Display(visible=0, size=(1024, 768)) 
display.start()

Solution 8 - Google Chrome

If your website is https, and having trouble with chromedriver on timedout issue, use

option.addArguments("enable-features=NetworkServiceInProcess")

If the above doesn't work, use

option.addArguments("disable-features=NetworkService") 

instead

Credit goes to https://groups.google.com/forum/#!topic/chromedriver-users/yHuW_Z7tdy0

Solution 9 - Google Chrome

I was seeing issues going from Chrome 72 to 73 and was getting the error message:

Timed out receiving message from renderer: 600.000

I was getting the error only when i was running tests on Jenkins (tests were running fine on my local development machine) which i found rather odd.

I tried Firefox and no issues found so this narrowed it down to Chrome. After looking through the Chromium issue tracker i found Issue 946441: Chromedriver: Timed out receiving message from renderer error for Selenium+Chrome+Jenkins(user SYSTEM)

As this was a renderer issue, i tried running tests in headless mode which resolved the issue.

Solution 10 - Google Chrome

I was seeing the Timed out receiving message from renderer: aka Net::ReadTimeout issue 100% of the time in a Cucumber test running in a Jenkins build env after the docker selenium/standalone-chrome image was updated in late Jan 2018. Adding the --disable-gpu attribute to the ChromeOptions did not fix it for me, but adding the --disable-browser-side-navigation option fixed it 100%. I found that recommendation here: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2239#c10

it said there are several workarounds to this issue:

  • A fix is in Chrome v65, which is currently available in beta. This is the best option if you can use beta builds.

  • Add --disable-browser-side-navigation switch to Chrome command line.

  • Use ChromeDriver 2.33, which automatically uses --disable-browser-side-navigation.

Solution 11 - Google Chrome

I encountered the same issue while triggering execution from Jenkins. I played around a bit and found that only adding the below chrome option makes thing work:

options.addArguments("--no-sandbox");

Solution 12 - Google Chrome

Sounds silly, but when the loops just doesn't end, try and check your internet connection.

Solution 13 - Google Chrome

Just addon hope this will help someone:If you are coding in python3

You are getting error like Instance of 'Options' has no 'addArguments' memberpylint(no-member) while using options.addArguments("--xxx") then you need to change addArguments to add_arguments
Like: options.add_argument("--xxxx")

Solution 14 - Google Chrome

I know the question as about Chromedriver, but for anyone like me who isn't specifically testing on Chrome and just needs a working headless browser in Selenium: switch to Firefox (Geckodriver). I set a single option and forgot all about these Chromedriver bugs and rendering problems:

from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
browser = webdriver.Firefox(options=options)

It just works (tm).

Solution 15 - Google Chrome

In order to execute chrome test cases parallel in a headless mode using jenkins 

options.addArguments("--no-sandbox"); 
options.addArguments("--disable-dev-shm-usage"); 
options.addArguments("--aggressive-cache-discard"); 
options.addArguments("--disable-cache"); 
options.addArguments("--disable-application-cache"); 
options.addArguments("--disable-offline-load-stale-cache"); 
options.addArguments("--disk-cache-size=0");
options.addArguments("--headless"); 
options.addArguments("--disable-gpu"); 
options.addArguments("--dns-prefetch-disable"); 
options.addArguments("--no-proxy-server"); 
options.addArguments("--log-level=3"); options.addArguments("--silent"); options.addArguments("--disable-browser-side-navigation"); options.setPageLoadStrategy(PageLoadStrategy.NORMAL); 
options.setProxy(null);

Solution 16 - Google Chrome

You need to disable the ChromeDriverService loggers.

Add the following method to whichever class is creating the driver,

and make sure call it once before creating any driver instances:

import org.openqa.selenium.chrome.ChromeDriverService;
import java.util.logging.Level;
import java.util.logging.Logger;

public static void disableSeleniumLogs() {    
    System.setProperty(ChromeDriverService.CHROME_DRIVER_SILENT_OUTPUT_PROPERTY, "true");
    Logger.getLogger("org.openqa.selenium").setLevel(Level.OFF);
}

Solution 17 - Google Chrome

You can overcome these timeout error by running Chromedriver executable file in Silent mode

System.setProperty("webdriver.chrome.driver","driver_path");
System.setProperty("webdriver.chrome.silentOutput", "true");

Solution 18 - Google Chrome

I found that in my case, the sporadic failures were because CPU resources would go up and down sporadically on the server which changes the time it takes to render elements or execute JS on a page. So, the ultimate solution for me was to simply increase the timeouts as follows:

// Driver constants and methods
const STD_TIMEOUT = 100000

let setDriverTimeout = async (timeout) => {
  await global.driver.manage().setTimeouts({
    implicit: timeout,
    pageLoad: timeout,
    script: timeout
  })
}

Here, if I use STD_TIMEOUT that is too small, I will get more of the error "timed out receiving message from renderer".

Also, as a side-note, I can trigger this to happen even more frequently by increasing the CPU throttling rate as such:

  global.driver = await new Builder()
    .forBrowser('chrome')
    .setChromeOptions(options)
    .build()

  await driver.sendDevToolsCommand(
    'Emulation.setCPUThrottlingRate', {
      rate: 1800
    }
  );

With a high rate such as 1800, the renderer will timeout very often.

Solution 19 - Google Chrome

THIS WORKS After googling through many many threads, I finally got the solution to such problems.

While most of the solutions above have pointed out the problem correctly which is arising due to bug in Chrome updates, follow below solution to get it fixed-

  1. Download and use the latest ChromeDriver- compatible with the version of Chrome
  2. Download the latest Selenium Driver from https://www.selenium.dev/ and execute the jar file on your system once.
  3. Run the you code again to see the magic

Solution 20 - Google Chrome

Seems Like browser is not loading the URL due to network issue or you quited the driver with driver.quit() in previous execution

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBrandon SchabellView Question on Stackoverflow
Solution 1 - Google ChromeJonathanView Answer on Stackoverflow
Solution 2 - Google ChromeAlex PodimovView Answer on Stackoverflow
Solution 3 - Google ChromeBrandon SchabellView Answer on Stackoverflow
Solution 4 - Google ChromeJayanth BalaView Answer on Stackoverflow
Solution 5 - Google ChromeMuzzamilView Answer on Stackoverflow
Solution 6 - Google Chromehighsoftx980View Answer on Stackoverflow
Solution 7 - Google ChromeShreyesh DesaiView Answer on Stackoverflow
Solution 8 - Google ChromeBhuvanesh ManiView Answer on Stackoverflow
Solution 9 - Google Chromejrc16View Answer on Stackoverflow
Solution 10 - Google ChromedansalmoView Answer on Stackoverflow
Solution 11 - Google ChromeSoumyaView Answer on Stackoverflow
Solution 12 - Google ChromeY-B CauseView Answer on Stackoverflow
Solution 13 - Google ChromeAshuView Answer on Stackoverflow
Solution 14 - Google ChromekontextifyView Answer on Stackoverflow
Solution 15 - Google ChromeArkeshView Answer on Stackoverflow
Solution 16 - Google ChromeHrisimir DakovView Answer on Stackoverflow
Solution 17 - Google ChromeChandresh kumarView Answer on Stackoverflow
Solution 18 - Google ChromethorieView Answer on Stackoverflow
Solution 19 - Google ChromeChetanya SaxenaView Answer on Stackoverflow
Solution 20 - Google ChromeO.T.B Harmony LimitedView Answer on Stackoverflow