Ranorex to fast for the application

Ask general questions here.
riccardo
Posts: 30
Joined: Wed Apr 28, 2010 10:37 pm

Ranorex to fast for the application

Post by riccardo » Fri May 13, 2011 4:39 pm

I would like to run my tests using the Turbo Mode but on some parts of the application there will be calculations done when selecting an ListItem from a Combo Box. Now the next step would be a click on a button which is already there before, visible and also enabled. Now while the calculation will be done, Ranorex tries to click the Button used in the next Step.

The mouse pointer changes during the calculation so the windows standard "busy" pointer (sandclock for xp, the round thing for Vista...). I would like to avoid using Delay code. Is it possible to check for the mouse pointer or something so the next step will only be done when the application is ready?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex to fast for the application

Post by Support Team » Sun May 15, 2011 5:11 pm

riccardo wrote:Is it possible to check for the mouse pointer or something so the next step will only be done when the application is ready?
Yes, this is possible, but usually not recommended. The recommended way is to wait for some attribute of a UI element to change, i.e. by searching for a RanoreXPath using this attribute.

However, if all that changes in your application really is the mouse cursor, then you can use the Mouse.Cursor and CursorName properties to get the current cursor. For example, the following code waits for the mouse cursor to change back to the default one; you can then add a user code action using that code:
public static void WaitForNormalCursor()
{
    while (Mouse.Cursor != System.Windows.Forms.Cursors.Default)
           System.Threading.Thread.Sleep(100);
}
Regards,
Alex
Ranorex Team
.
Image

riccardo
Posts: 30
Joined: Wed Apr 28, 2010 10:37 pm

Re: Ranorex to fast for the application

Post by riccardo » Mon May 16, 2011 9:21 am

Works like a charm :D

Thank you