scroll down HTML code example
Example 1: javascript scroll down
window.scrollTo(300, 500); //X=300 and Y=500
Example 2: how to scroll down
I can either scroll down a page by using window.scrollBy() function
from java script
Example:
((JavascriptExecutor) driver).executeScript("window.scrollBy(0,500)");
Or I use Action class:
Actions actions = new Actions(driver);
actions.sendKeys(Keys.ARROW_UP)
.sendKeys(Keys.ARROW_DOWN)
.sendKeys(Keys.PAGE_DOWN) —> to scroll down
.sendKeys(Keys.PAGE_UP) —> to scroll up