Page 1 of 1

Ranorex to fast for the application

Posted: Fri May 13, 2011 4:39 pm
by riccardo
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?

Re: Ranorex to fast for the application

Posted: Sun May 15, 2011 5:11 pm
by Support Team
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

Re: Ranorex to fast for the application

Posted: Mon May 16, 2011 9:21 am
by riccardo
Works like a charm :D

Thank you