I am creating a test and have some problems. Here is the script. I use the Selenium Web driver to fill out the form on page 1 and submit the form by clicking a button. Page2 starts loading ... but the problem is that the page uses Google Analytics codes, and sometimes the page stops loading forever.
Although the expected element is already present, the Selenium web driver does not work until the entire web page is fully loaded.
How to get Selenium to go to the next task or stop loading external javascript / css if the expected element is already present?
I tried to configure the following settings, but no luck.
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
TEMPORARY RESOLUTION: scroll below to answer!
source share