Problem with Mouse.ScrollWheel

Ask general questions here.
costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Problem with Mouse.ScrollWheel

Post by costamesakid » Tue Oct 26, 2010 11:21 pm

According to the Ranorex API documentation I can use the Mouse.ScrollWheel method to simulate scrolling of the the mouse wheel. However, after I set the focus on my application the following code does not scroll the mouse wheel in either firection. Any ideas? Thanks


Mouse.ScrollWheel(-120);
Report.Info("Mouse Scroll Down");

Mouse.ScrollWheel(120);
Report.Info("Mouse Scroll Up");

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Problem with Mouse.ScrollWheel

Post by Ciege » Tue Oct 26, 2010 11:38 pm

I've not ever tried it myself, however... did you try a mouse.click on the object before using the scroll?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Problem with Mouse.ScrollWheel

Post by Support Team » Wed Oct 27, 2010 2:20 pm

Hi,

Would it be possible to send us a Ranorex Snapshot of the whole application to check what you are trying to do?

Thanks in advance.

Regards,
Peter
Ranorex Team

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Problem with Mouse.ScrollWheel

Post by brgibb » Mon Jul 08, 2013 8:43 am

I'm trying a similar thing and can't seem to get Mouse.ScrollWheel(-500); to do anything either.

I'm using this as I can't seem to get the scrollbar element via the Spytool.

This is on chrome.

Any thoughts?

sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

Re: Problem with Mouse.ScrollWheel

Post by sergii » Mon Jul 08, 2013 2:08 pm

I have the same issue: unable to scroll mouse on chrome in both manual and user code modes.
During these attempts chrome is often displaying message: Ranorex Extension become unresponsive. Would you like to continue waiting? - and the same appears each time if I agree to wait.
Latest Chrome version.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Problem with Mouse.ScrollWheel

Post by Support Team » Tue Jul 09, 2013 12:44 pm

Hello,

Please note that the application needs to have the focus by using a mouse click e.g.
Could you please try to create a new recording, click on our forum webpage and perform scroll actions?
Do you see this behavior in other browsers as well?
Which Ranorex version do you use?

Could you please send us a Ranorex Snapshot?
This would help us to analyze your issue.
Please take a look at Creating Ranorex Snapshot Files in our User Guide.

Thank you in advance.

Regards,
Markus (T)

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Problem with Mouse.ScrollWheel

Post by brgibb » Wed Jul 10, 2013 8:24 am

I can't speak for sergii but I'm not currently in a position to send a snapshot.

I have essentially 2 lines of C# code...the first clicks on an element on the screen...the next attempts to scroll down....that's it....but stepping through the code it just sails straight through with no scrolling.

I'm using Ranorex 4.0.4 and Chrome 27.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Problem with Mouse.ScrollWheel

Post by Support Team » Thu Jul 11, 2013 1:41 pm

Hello,

The method Mouse.ScrollWheel(int delta) specifies the amount of wheel movement. I suppose you have one method similar to the following
Mouse.ScrollWheel(-500);
Since the high delta (500) is used in the code, the scroll operation is quite fast.

You could split this single action into several actions with a smaller value (e.g. 50) to scroll slowly.
Would that be a possible solution for you?

Regards,
Markus (T)

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Problem with Mouse.ScrollWheel

Post by brgibb » Tue Jul 16, 2013 11:53 am

Hi,

It's very weird....the scrollbar just doesn't move at all. The view of the webpage I'm testing doesn't change.

It's essentially as if the Mouse.ScrollWheel(-500); line isn't there at all ...........which given this is a fairly fundamental operation I find very surprising.

There must be something silly going on here. I'll continue to play with this using smaller values.

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Problem with Mouse.ScrollWheel

Post by brgibb » Wed Jul 17, 2013 10:06 am

Right I've sussed it - I've been a bit dozy and was using .PerformClick() rather than .Click() before scrolling.

using .Click() it now works expected.

:-/

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Problem with Mouse.ScrollWheel

Post by Support Team » Wed Jul 17, 2013 11:02 am

Hello,

Thanks for the good news :-)

Regards,
Markus (T)