Is there a way to determine if I have scrolled to the bottom of the page vertically?
I have been using Webdriver and pressing the page down key repeatedly within a for loop, like so:
for(int di=0; di<40; di++) {
driver.findElement(By.tagName("body")).sendKeys(Keys.PAGE_DOWN);
Thread.sleep(1500);
}
However, my for loop always runs 40 times regardless of the actual size of the page. I am looking for a solution to accurately detect when I have reached the end of the page so that I can break out of the loop at that point.