Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

1
How to scroll a page vertically by 80px with Selenium Webdriver and Java?

Open 1 Answers 31 Views
1 1
How to scroll a page vertically by 80px with Selenium Webdriver and Java?

1 Answer

0
0

Scrolling up should be as below.

((JavascriptExecutor) driver).executeScript("scroll(0,-80);");
 
To scroll down
 
((JavascriptExecutor) driver).executeScript("scroll(0,80);");
 
You need to figure out equivalent value of 80px here. As -80 is not equivalant to 80px
 
Hope that helps.
answered by (151 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...