2

I am new to Selenium and I have been working on Selenium Webdriver. I have a huge list in a drop down and I want to move the scroll bar down using the click of a mouse. So, my question is "How to move scroll bar in drop down using mouse click in Selenium Webdriver?" . Any help would be great.

Thank you in advance.

Rohit
  • 73
  • 7
  • Why don't you use Java-Robot for these kind of stuffs? – Prashanth Sams Apr 14 '14 at 05:33
  • please, look on Maddy's answer: http://stackoverflow.com/a/17333551/2637095 – Sergii Tanchenko Apr 14 '14 at 06:49
  • @СергійТанченко That method you have suggested is not really working for me, I have already tried that method. anyways thank you for your answer. Appreciate a lot. – Rohit Apr 15 '14 at 08:31
  • @PrashanthSams I have used robot method but the problem is that it is not able to locate that element exactly. The mouse is moving to somewhere else even when I am giving correct co ordinates of the element to it. Thank you for your previous answer and It would be helpful if you provide any example on robot method related to drop down scroll bar element. – Rohit Apr 15 '14 at 08:36

1 Answers1

1

An alternate approach could be using the "location_once_scrolled_into_view" method on the element in the list you want to scroll into view.

With respect to Prashanth suggestion of JavaRobot, I am unsure if it can be used with RemoteWebdriver when executed via a remote machine. I appreciate if you are new then running tests on a remote grid is not an immediate concer, but there is little point restricting yourself to local execution if there is an exclusively Selenium answer to your solution. Apologies if Robot does support grid execution.

Robbie Wareham
  • 3,380
  • 1
  • 20
  • 38