Page 1 of 1

Problem with Mouse.ScrollWheel

Posted: Tue Oct 26, 2010 11:21 pm
by costamesakid
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");

Re: Problem with Mouse.ScrollWheel

Posted: Tue Oct 26, 2010 11:38 pm
by Ciege
I've not ever tried it myself, however... did you try a mouse.click on the object before using the scroll?

Re: Problem with Mouse.ScrollWheel

Posted: Wed Oct 27, 2010 2:20 pm
by Support Team
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

Re: Problem with Mouse.ScrollWheel

Posted: Mon Jul 08, 2013 8:43 am
by brgibb
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?

Re: Problem with Mouse.ScrollWheel

Posted: Mon Jul 08, 2013 2:08 pm
by sergii
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.

Re: Problem with Mouse.ScrollWheel

Posted: Tue Jul 09, 2013 12:44 pm
by Support Team
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)

Re: Problem with Mouse.ScrollWheel

Posted: Wed Jul 10, 2013 8:24 am
by brgibb
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.

Re: Problem with Mouse.ScrollWheel

Posted: Thu Jul 11, 2013 1:41 pm
by Support Team
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)

Re: Problem with Mouse.ScrollWheel

Posted: Tue Jul 16, 2013 11:53 am
by brgibb
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.

Re: Problem with Mouse.ScrollWheel

Posted: Wed Jul 17, 2013 10:06 am
by brgibb
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.

:-/

Re: Problem with Mouse.ScrollWheel

Posted: Wed Jul 17, 2013 11:02 am
by Support Team
Hello,

Thanks for the good news :-)

Regards,
Markus (T)