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 – “https://www.softwaretestingmaterial.com”
  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.

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook

DOWNLOAD FOR FREE