How To Generate Mouse Scrolling Event Using Selenium IDE With Example Tutorial

Last updated on June 20th, 2025 at 04:27 am

Many tutorial post are available for selenium IDE Mouse related commands but mouse scrolling event was missing from them till now. You need mouse scrolling event when you are testing software application like Facebook. In Facebook, post are loaded on mouse scrolling if you have seen. In this kind of scenario,

you need to generate mouse scrolling event in selenium IDE.

Let me give you an example. First of all open one page which contains vertical scroll bar(long description page) and then run bellow test case in selenium IDE.

New Test
CommandTargetValue
store40i
store0looptimes
whilestoredVars.looptimes <= 20
storeEvalselenium.browserbot.
getCurrentWindow().scrollTo(0,${i})
storejavascript{storedVars.looptimes++;}
storeEval${i}+40i
endWhile

(Note : You need to attache user-extension.js file with selenium IDE to get support of “while” command in selenium IDE. Click here to view steps of downloading and installing user-extension.js file with selenium IDE.)
When you run above script in selenium IDE, it will scroll your page vertically if scroll bar is there on page.
  • You can change while loop value from ’20’ to your choice depending on length of page. If page is lengthy then increase that value.
  • ‘selenium.browserbot.getCurrentWindow().scrollTo(0,${i})’ is used with “storeEval” command for generating scroll event on page using selenium IDE. If you want to generate scroll event on horizontal scroll bar then use ”selenium.browserbot.getCurrentWindow().scrollTo(${i},0)”. It will create horizontal scrolling event on software web application page.
  • In above script you can change ${i}+40 –> ${i}+60 to increase or ${i}+40 –> ${i}+20 to decrease scrolling speed.
author avatar
Aravind
Stay Updated with New Articles
Get the latest tutorials and insights delivered to your inbox.

12 thoughts on “How To Generate Mouse Scrolling Event Using Selenium IDE With Example Tutorial

  1. hey. i am testing a website and clicking on a button, after that i get an error of "unexpected alert". Can you tell me how to handle such unexpected alerts using selenium ide?

  2. pls help me anyone,In my project use the two calender start date or end date but they select one calender value and calender is not close .pls tell me

Leave a Reply

Your email address will not be published. Required fields are marked *