How To Scroll Web page using Actions Class In Selenium

To Scroll Web page using Actions Class in Selenium WebDriver:

Let’s see how to Scroll Web Page using Actions Class in this post. There are few ways to scroll Web page UP or DOWN. We are going to see those in this post in detail.

To achieve this we use Actions class in Selenium WebDriver.

Must Read: Actions Class in Selenium WebDriver

Use sendKeys() method and pass parameters as PAGE_UP or PAGE_DOWN to achieve our required goal.

Scenario to be automated

  1. Launch the web browser and open the application – “”
  2. Do scroll down
  3. Do scroll up
  4. Close the browser

Given clear explanation in the comments section with in the program itself. Please go through it to understand the flow.

This can be achieved by using JavascriptExecutor too.

See this: Page Up and Page Down Using JavascriptExecutor

If you are not regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.

Scroll Web page using Actions Class

Rajkumar SM is a founder of SoftwareTestingMaterial. He is a certified Software Test Engineer by profession and blogger & youtuber by choice. He has an extensive experience in the field of Software Testing. He writes here about Software Testing which includes both Manual and Automation Testing. He loves to be with his wife and cute little kid 'Freedom'.

Leave a Comment

Share via
Copy link
Powered by Social Snap