Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium Timed out receiving message from renderer

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.

like image 324
Brandon Schabell Avatar asked Jan 25 '18 19:01

Brandon Schabell


People also ask

Why do we get timeout exception in selenium?

In Selenium, TimeOut exception occurs when a command takes longer than the wait time to avoid the ElementNotVisible Exception. If the commands do not complete even after the wait time is over, a TimeOut Exception is thrown.

What is the use of pageLoadTimeout in selenium?

pageLoadTimeout in Selenium This sets the time to wait for a page to load completely before throwing an error. If the timeout is negative, page loads can be indefinite.

What is page load timeout?

This defines the amount of time that Selenium will wait for a page to load. By default, it is set to 0 (which equates to an infinite time out). If you want to ensure that an error is thrown if your page takes longer than expected to load, you can modify this by using this line of code: driver.


1 Answers

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-infobars"); //https://stackoverflow.com/a/43840128/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); 

Sources:

  • https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
  • https://stackoverflow.com/a/26283818/1689770
  • https://stackoverflow.com/a/43840128/1689770
  • https://stackoverflow.com/a/50725918/1689770
  • https://stackoverflow.com/a/43840128/1689770
  • https://stackoverflow.com/a/50725918/1689770
  • https://stackoverflow.com/a/49123152/1689770
  • how to solve Selenium ChromeDriver Timed out receiving message from renderer exception
like image 162
Jonathan Avatar answered Sep 20 '22 00:09

Jonathan