I'm currently experimenting with scrolling a vertical scroll-bar without moving the entire page using JavaScript.
Below is the code snippet I am utilizing:
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.w3schools.com/html/default.asp");
Actions actions = new Actions(driver);
actions.MoveToElement(driver.FindElement(By.Id("leftmenuinnerinner"))).MoveToElement(driver.FindElement(By.Id("leftmenuinner"))).Build().Perform();
for (int i =0;i <= 1000; i++)
{
((IJavaScriptExecutor)driver).ExecuteScript("window.scrollBy(0,10)");
System.Threading.Thread.Sleep(10);
}
However, this code causes the entire page to scroll instead of just the scroll bar. Any suggestions on how to achieve the desired effect?