2

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

  • 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
4

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.

| 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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