Mouse wheel

640 views
Skip to first unread message

Vince Bob

unread,
Jul 5, 2017, 8:49:18 AM7/5/17
to robotframework-users
Hello all,
I am quite new in robot framework but I need to simulate several mouse wheel steps over an element in a web page.
I am obviously using Selenium2Library but couldn't find any keyword to do this?
Any ideas?

Vincent

Tatu Aalto

unread,
Jul 5, 2017, 9:43:07 AM7/5/17
to vin1...@gmail.com, robotframework-users
Ugh

Mouse wheel support doesn't exist in the selenium API and therefore Selenium2Library doesn't have it either. But is it important to scroll with mouse? Or is it important to make sure that user can scroll, specially if lazy generation is used, to the specific point in the page?

-Tatu
Send from my mobile

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Vince Bob

unread,
Jul 6, 2017, 2:55:29 AM7/6/17
to robotframework-users, vin1...@gmail.com
Hello,

thanks for your answer,
Actually I have a window in my web page displaying several images, I use mousewheel actions to navigate through these images; so yes, I would like to test this behavior is still possible.
So, if it is not possible, I can assign key actions in addition to mouse wheel, but I have another question: how do I focus the window to send key action?

Vincent

 

Tatu Aalto

unread,
Jul 6, 2017, 11:15:57 AM7/6/17
to vin1...@gmail.com, robotframework-users
Ugh

If you really need mouse scrolling, then pyoutogui might be able to help you: https://pyautogui.readthedocs.io/en/latest/mouse.html#mouse-scrolling

Focus is difficult thing, because selenium does not need a focus to interact with the browser. Also selenium does not provide means to focus, because that is controlled by the operating system and operating system may decide whatever it wants from the focus. Again I would be looking to the pyoutogui direction if you need a focus.

-Tatu
Send from my mobile

--

David

unread,
Jul 6, 2017, 3:35:59 PM7/6/17
to robotframework-users
If you want to attempt mouse wheel scrolling via javascript (via Selenium) you might want to look at this: https://stackoverflow.com/questions/6735830/how-to-fire-mouse-wheel-event-in-firefox-with-javascript

Vince Bob

unread,
Jul 7, 2017, 10:56:57 AM7/7/17
to robotframework-users
Thanks guys!!
Reply all
Reply to author
Forward
0 new messages