who knows how to simulate mouse wheel in selenium

6,720 views
Skip to first unread message

Yan Lincle

unread,
Dec 12, 2013, 4:13:55 AM12/12/13
to webd...@googlegroups.com
I know the class actions can simulate mouse press ,hold and drop etc.Today I encoutered a problem ,need to simulate mouse wheel ,how to simulate it?who knows?

Jakub Siberski

unread,
Dec 12, 2013, 4:46:55 AM12/12/13
to webd...@googlegroups.com


On Thu, Dec 12, 2013 at 10:13 AM, Yan Lincle <ycqy...@gmail.com> wrote:
I know the class actions can simulate mouse press ,hold and drop etc.Today I encoutered a problem ,need to simulate mouse wheel ,how to simulate it?who knows?

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



--
Jakub

David

unread,
Dec 12, 2013, 8:43:47 PM12/12/13
to webd...@googlegroups.com
Do you "really" need to replicate/automate/simulate the mouse wheel scrolling? Or just scrolling in general?

If scrolling in general, then what Jakub mentions should suffice, and probably easier.

If actual simulation of mouse wheel scrolling, I'm not aware if the native Actions class offers that. But you can likely simulate with Javascript, but it's different from what Jakub suggested, it's more like this:


I've implemented a wrapper to that myself but have not had the time to fully test out whether that actually works (well) in practice or not. But you're welcome to try and let us know how it worked out for you.

Yan Lincle

unread,
Dec 12, 2013, 9:26:00 PM12/12/13
to webd...@googlegroups.com
hi,siberski:
   thank you for your reply,actually,I know this way.it really works.but you know ,in case,I will try not to use javscript method,it is really not close to the real user do.but still thank you

Yan Lincle

unread,
Dec 12, 2013, 9:28:52 PM12/12/13
to webd...@googlegroups.com
hi,David:
   I read the article yesterday,yes ,I will try to use it ,and tell you whether it works for me.
Reply all
Reply to author
Forward
0 new messages