Page 1 of 1
WaitFor action - more options?
Posted: Wed Aug 06, 2014 3:27 pm
by DominikR
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?
Re: WaitFor action - more options?
Posted: Wed Aug 06, 2014 3:49 pm
by krstcs
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