I want selenium to force the browser to reload the page which it is loading if the loading process takes too long.
From StackOverflow I have that this code
new WebDriverWait(driver, 30).until((ExpectedCondition<Boolean>) wd -> ((JavascriptExecutor) wd)
.executeScript("return document.readyState").equals("complete"));
will wait until the page is fully loaded, but I want it to be reloaded if it takes more than 30 seconds.
How can I achieve that?