title: Selenium webdriver - End of the page(using vertical scroll)
body: <p>How can I check if I reached the end of the page (using vertical scroll)?</p>
  
  <p>From the Webdriver - press the page down key till end of the page. Using for loop I have done this :</p>
  
  <pre><code>for(int di=0; di&lt;40; di++) { 
     driver.findElement(By.tagName("body")).sendKeys(Keys.PAGE_DOWN);
     Thread.sleep(1500);
  }
  </code></pre>
  
  <p>My for loop always executed 40 times even its less size. So I need help how I can check if it reached the end of the page, because if I reached then I will break and come out of the loop.</p>