2

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

1
  • 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, 2011 at 14:59

1 Answer 1

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.

1
  • Thansk a lot. I can use :selenium.getEval("window.scrollTo(0,0)");
    – smriti
    Jun 27, 2011 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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