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?
WaitFor action - more options?
Re: WaitFor action - more options?
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:
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.
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
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.)
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']
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...