I have written the following code in Selenium 1 (a.k.a Selenium RC) for page scrolling using java:
selenium.getEval("scrollBy(0, 250)");
What is the equivalent code in Selenium 2 (WebDriver)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Scenario/Test steps:
For Scroll down:
OR, you can do as follows:
For Scroll up:
Scroll to the bottom of the page:
Scenario/Test steps:
Way 1: By using JavaScriptExecutor
Way 2: By pressing ctrl+end
Way 3: By using Java Robot class