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

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

1 Answer

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 Oct 14, 2016 by stbadmin (4,970 points)
...