Saturday, August 25, 2018

Timed out receiving message from renderer in selenium

This post explains how to handle Timed out receiving message from renderer issue with the help of selenium webdriver.
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 3 to 4 mins to load page, in that case you will see TimeoutException exception in your console.
Jul 06, 2018 4:07:01 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
[1530864721.448][SEVERE]: Timed out receiving message from renderer: 298.565
[1530864721.449][SEVERE]: Timed out receiving message from renderer: -0.004
[1530864721.469][SEVERE]: Timed out receiving message from renderer: -0.024



Solution to Overcome/Solve Timed out receiving message from renderer issue  :

When Page Loading takes too much time and you need to stop downloading additional subresources (images, css, js etc) you can change the  pageLoadStrategy through the webdriver.

As of this writing, pageLoadStrategy supports the following values :
Page load strategy for Chrome driver (Updated till Selenium v3.12.0)
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.

Example :
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);

Hope this example solve your timeout exception issue in selenium. In case of any issues, please do comment in comment box below.



17 comments:

  1. While executing testcase getting
    [1540801449.733][SEVERE]: Timed out receiving message from renderer: 600.000
    [1540801749.734][SEVERE]: Timed out receiving message from renderer: 300.000
    [1540802349.734][SEVERE]: Timed out receiving message from renderer: 600.000
    [1540802349.734][SEVERE]: Timed out receiving message from renderer: -600.002
    [1540802649.739][SEVERE]: Timed out receiving message from renderer: 300.000
    [1540803249.739][SEVERE]: Timed out receiving message from renderer: 600.000
    [1540803249.740][SEVERE]: Timed out receiving message from renderer: -600.001


    ChromeDriver : 2.43.600210
    Chrome Version : 70.0.3538.77

    ReplyDelete
    Replies
    1. apply below line code in selenium script :
      ChromeOptions options = new ChromeOptions();
      options.setPageLoadStrategy(PageLoadStrategy.NONE);
      // Instantiate the chrome driver
      driver = new ChromeDriver(options);

      Delete
  2. Tho PageLoadStrategy.EAGER is not supported for now.

    Great thanks for this article, helped a lot.

    ReplyDelete
  3. how to handle the same issue in internet explorer

    ReplyDelete
  4. HI,

    Thanks for your solution but it is not working in my case. When I am running it on my machine(without jenkins). chrome is initiated successfully and automation scripts are executed but when I do the same from jenkins. It keeps on giving below error:
    [1554447408.210][SEVERE]: Timed out receiving message from renderer: 600.000

    I have tried your solution also but not helping.
    Chrome browser version- Version 73.0.3683.86 (Official Build) (64-bit)
    chrome driver exe: 73(recent stable version)
    Selenium: 3.12

    Can you pls help

    ReplyDelete
  5. Iam facing the same issue, Did you get the solution?

    ReplyDelete
  6. Did we get solution for this issue?

    ReplyDelete
  7. any solution for this issue?

    ReplyDelete
  8. didnt work for me, getting this error
    Timed out receiving message from renderer: 0.100

    ReplyDelete
  9. Same issue any other solution?

    ReplyDelete
  10. can someone please respond on this?
    I tried below option:
    ChromeOptions options = new ChromeOptions();
    options.setPageLoadStrategy(PageLoadStrategy.NONE);

    still not working. Getting same issue.

    ReplyDelete
  11. This is not going to work :
    ChromeOptions options = new ChromeOptions();
    options.setPageLoadStrategy(PageLoadStrategy.NONE);

    this will only stop the processing which is not a solution really .

    ReplyDelete
  12. I had the same problem:
    [1590022141.990][SEVERE]: Timed out receiving message from renderer: 300.000
    [1590022141.991][SEVERE]: Timed out receiving message from renderer: -0.001
    It happened alter the application changes were made for performance improvements.
    I had the same driver working fine and that timeout problems started to appear
    I my case PageLoadStrategy change to NONE fixed the issue!

    ReplyDelete
  13. I used it, errors are gone but initiates 2 web browsers ... I mean I prefer that though, but if someone figures a fix for that, would be awesome

    ReplyDelete