TestProject Forum
Powered by leading experts in the test automation community

Scroll window horizontally

How do i scroll the window horizontally with selenium ?

the framework does not suggest any ‘scroll’ method with intellisense.

You can achieve this with JavascriptExecuter:

JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("scroll(3000, 0);");    // scroll right
jsExecutor.executeScript("scroll(-3000, 0);");    // scroll left

Thanks again for the help Oren.