How to Scroll into view in Selenium Webdriver

Some days back I was automating my application I got one scenario where I had so many scroll bar into single page itself and I have to scroll all bar one by one to get specific text which I had to validate.

If you are not aware of how to validate text then below post will help you How to verify text in Selenium

You might have requirement to scroll down page but this requirement was different so here I used Java Script executor, which allowed me to scroll into view.

If you want to scroll down page itself then you can check below post which allow us to to the same.

Scroll into view in Selenium


How to scroll down into page using Selenium Webdriver

How to Scroll into view in Selenium Webdriver.

Now let us talk about how exactly we can scroll this using Selenium. Unfortunately Selenium does not have inbuilt method which allow us to scroll into view but it does not mean we cannot scroll.

We can scroll into view in Selenium using JavaScript executor.

You must be wondering now Java Script will help us in this case. I have created a post, which actually tells you what is the need of JavaScript in Selenium, and what are the other thing, which we can do via Java Script.

What is Java Script Executor in Selenium and What are the Usage of Same.



Recently I have uploaded a video on the same please check.


Program for Scroll into view in Selenium Webdriver

Now we will see the detailed program for this we actually scroll into view in Selenium, will extract the text, and will verify the same.

In my case, I am just verifying it but in your case, you may have to perform some other activity as well.

I will be using this application as Sample- Sample Application for Demo

If you find this useful then please share with friends. Comment below if any doubt, suggestion or feedback.

For More updates Learn Automation page

For any query join Selenium group- Selenium Group


  1. Mohammed Shahab Ahmed
  2. Abhishek Singh
  3. Rasta Jeff
  4. Ann
  5. Vishy
  6. Karl Fokum
  7. manoj kumar mahato
  8. Vahe
  9. salma