title: looking for option to check if page fully loaded with all elements in java for selenium
body: <p>I am looking for function in <strong>Java</strong> +selenium where I can check or verify if page is fully loaded. I saw <code>onLoad()</code> of JS but nothing on java, is there is something for JAVA?</p>
  
  <p>also I saw these:</p>
  
  <pre><code>WebDriver driver = new AnyDriverYouWant();
  if (driver instanceof JavascriptExecutor) {
     ((JavascriptExecutor)driver).executeScript("yourScript();");
  } else {
     throw new IllegalStateException("This driver does not support JavaScript!");
  }
  </code></pre>
  
  <p>but again JS and need to write script in JS
  <a href="https://stackoverflow.com/questions/11430773/how-to-use-javascript-with-selenium-webdriver-java">How to use JavaScript with Selenium WebDriver Java</a></p>
  
  <p><strong>update</strong> - also can try these solution too:
  <code>void waitForLoad(WebDriver driver) { 
  new WebDriverWait(driver, 30).until((ExpectedCondition&lt;Boolean&gt;) wd -&gt; ((JavascriptExecutor) wd).executeScript("return document.readyState").equals("complete")); }</code></p>
  
  <p>from here <a href="https://stackoverflow.com/a/15124562/12115696">https://stackoverflow.com/a/15124562/12115696</a></p>