scroll down code example
Example: 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