2

I am using chromedriver for selenium automation.But webpage loading is very slow compared to manual testing.Kindly help

Getting error:

[1596549682.992][SEVERE]: Timed out receiving message from renderer: 300.000

Code trials:

ChromeOptions option=new ChromeOptions();
option.setPageLoadStrategy(PageLoadStrategy.NORMAL);
option.addArguments("--disable-features=NetworkService");
option.addArguments("--dns-prefetch-disable");
option.addArguments("--disable-extensions");
option.setProxy(null);
driver = new ChromeDriver(option);

Chrome version:84 Chrome driver Version:84 Selenium version:Tried 3.141.59 and 3.5.2

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Hanna
  • 33
  • 1
  • 7
  • Why do you need `--disable-features=NetworkService`, `--dns-prefetch-disable` and `--disable-extensions`? What is your usecase? – undetected Selenium Aug 04 '20 at 14:53
  • i tried this because it was given as solution which is not working.My issue is when running the testcase sometimes pages are getting loaded fastt,but sometimes its taking too much time and giving timout exception.Should i add anything to option.I tried pageloadtimeout and implicit wait which is also not working. – Hanna Aug 04 '20 at 16:04

1 Answers1

2

Selenium by default implements pageLoadStrategy as NORMAL. So explicitly setting the same won't make any difference.

However, to avoid waiting for the slowly loading webpage you can set the capability java.lang.String PAGE_LOAD_STRATEGY as none as follows:

ChromeOptions option=new ChromeOptions();
option.setPageLoadStrategy(PageLoadStrategy.NONE);
driver = new ChromeDriver(option);

References

You can find a couple of relevant detailed discussions in:


Timed out receiving message from renderer

To address this error you need to update ChromeDriver and versions accordingly following the discussion in Timed out receiving message from renderer: 0.100 log messages using ChromeDriver and Chrome v80 through Selenium Java

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352