title: Selenium wait until document is ready
body: <p>Can anyone let me how can I make selenium wait until the time the page loads completely? I want something generic, I know I can configure WebDriverWait and call something like 'find' to make it wait but I don't go that far. I just need to test that the page loads successfully and move on to next page to test.</p>
  
  <p>I found something in .net but couldn't make it work in java ...</p>
  
  <pre><code>IWait&lt;IWebDriver&gt; wait = new OpenQA.Selenium.Support.UI.WebDriverWait(driver, TimeSpan.FromSeconds(30.00));
  wait.Until(driver1 =&gt; ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").Equals("complete"));
  </code></pre>
  
  <p>Any thoughts anyone?</p>