So its throwing “unknown error: You can get full code from here Scroll Page in Selenium. Selenium Script import org. Here is the HTML snippet. By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies. Good point kind sir. If you want to scroll up in a vertical direction, you can use the following JavaScript.

Uploader: Nasho
Date Added: 28 December 2005
File Size: 18.90 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 54730
Price: Free* [*Free Regsitration Required]

How to Scroll Down or UP a Page in Selenium Webdriver

You could try this. Let me give you an example Go to www. How can I scroll up the page? Summary In the above tutorial, we illustrate the scroll of the web page through different scenarios. Tapan Khimani 39 6.

Post as a guest Name. It doesn’t worked for doqn. This question has been asked before and already has an answer. You can use the following code to import.


Some web application, have a functionality to drag web elements and drop them on defined area or Sign up using Facebook. Dhiman 3, 4 17 I would suggest using the ActionChains Actions in Java class to do so.

In such cases scrolling may be necessary. Something like this might yo Mukesh Otwani 4 2.

How To Scroll Web Page Down Or UP Using Selenium WebDriver

I did not think of that type of use case. Try usinng following code, it worked for me – JavascriptExecutor d. Selenium Script import org. Stack Overflow works best with JavaScript enabled. This code may not work with Selenium 3 jars.

No – that will scroll to the right.

I did some improvement. Where an ” Element ” is the locator on the web page. Put your distances as per your requirements. Can you give me an example.

How to scroll the Page up or down in Selenium WebDriver? (using java) | edureka! Forum

Both scroll ,0 and scroll 0, should work for scroll up. If you want to scroll up in a vertical direction, you can use the following JavaScript. Som Ghosh Try with FF and let me know.


The syntax of ScrollBy methods is: Simply using key strokes doesn’t work out. This worked for me. The Scroll element in the page is actually a div with scfoll bound to it.

Please enter a valid emailid. As the page which I’m testing, loads as we scroll down. Javascript method scrollTo scroll the till the end of the page.

Author: admin