WaitFor action - more options?

Class library usage, coding and language questions.
DominikR
Posts: 5
Joined: Tue Aug 05, 2014 9:15 am

WaitFor action - more options?

Post by DominikR » Wed Aug 06, 2014 3:27 pm

Currently WaitFor only supports exists and non-exists. For web development it would be really great to have "wait for visible" and "wait for enabled" options.

Is there another way to do that?

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: WaitFor action - more options?

Post by krstcs » Wed Aug 06, 2014 3:49 pm

If you craft your XPaths to include the attributes you want to wait for, the Exists/NotExists works the way you are wanting.

For example, if you are wanting to wait for a button to be in the enabled state before you click it, then you can set your buttons path like this:

Code: Select all

OKButton -> /button[@text='OK' and @enabled='true']  (or @visible='true', etc.)
If you need different attributes for the same object, you can create multiple objects in the repo that represent the same element but with different path combinations.

Code: Select all

OKButton_VISIBLE -> /button[@text='OK' and @visible='true']
OKButton_ENABLED -> /button[@text='OK' and @enabled='true']
OKButton_ENABLED_AND_VISIBLE -> /button[@text='OK' and @enabled='true' and @visible='true']
Just put them under the same rooted folder/app.

Then you can wait for the button to exist, and Ranorex will try to find a button that is enabled and has text of 'OK'. Your action table would look like:

WaitFor -> Exists -> 30s -> OKButton
Mouse -> Click -> Left -> Center -> OKButton
Shortcuts usually aren't...