How do I run ExecuteScript
before document ready? The page is already rendered but some scripts that is not relative to the display (such google analytics) are still downloading (and it's very slow).
var driver = new ChromeDriver();
driver.ExecuteScript("window.location='https://veryslowendblockscriptloading.com';");
driver.ExecuteScript("alert('bonjour')"); // This line takes forever to load even if it's independent of DOM.
I'm using Selenium Webdriver on Chrome 59. This behaviour is only on Chrome.
What I've tried.
I tried to set driver.Manage().Timeouts().PageLoad
to short value (5 seconds) but it looks like webdriver stop loading page (as if i press escape button) when the timeout reached and I don't need this behaviour
It's not a duplicate question as my issue is only on chromedriver.