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