Scroll Web Page
We can scroll the web page using JavaScript Executor in the java code. I have taken the below examples with Five different scenarios of scrolling a webpage.
Scroll Down
Scroll up
Scroll bottom of the Page
Full scroll to bottom in slow motion
automatically to your Web Element
1.Scroll Down:
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class PageScrollDown {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
//Launching the browser application
driver.get("http://www.javaseleniumworld.com/");
//Adding wait
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
//Maxi