Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.