Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can we use Selenium RC to move the browser's scroll bar up or down?

share|improve this question
A better way to word the question might be, "Can you use Selenium RC to move the browser's scroll bar up or down?" – user246 Jun 26 '11 at 14:59
up vote 4 down vote accepted

I assume you are referring to a scroll bar for the entire browser, as opposed to a scroll bar for a piece of the page (e.g. a list) in the browser.

I do not believe there is a Selenium API for moving the browser's scroll bar up or down. However, you can use the RemoteWebdriver.executeScript method to run some JavaScript that will scroll the entire browser. In JavaScript, you can use the ScrollBy and ScrollTo methods on the DOM Window object.

share|improve this answer
Thansk a lot. I can use :selenium.getEval("window.scrollTo(0,0)"); – smriti Jun 27 '11 at 8:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.