Page 1 of 1

How can I click a button only if it is visible on the page ?

Posted: Wed Aug 20, 2014 12:12 pm
by rastek
Hi,

I can use if-else statements inside user code but what I need is to accomplish this task without any coding. I need to use if statement in recording level, Write now only "if" statement is enough for me.

For example I want to click a button only if it is visible on the page.

There was something for this purpose in QTP; for example OptionalStep that means that step will be run if only the object exists on the page.

I hope there is some similar structure in Ranorex.

Thanks,
Rastek.

Re: How can I click a button only if it is visible on the page ?

Posted: Fri Aug 22, 2014 12:32 pm
by Support Team
Hi rastek,

Unfortunately there is no possibility to use an if statement in the recording level. But you can set optional actions in your recording module.

If you want to set an optional action, just right click on the desired action and select “Enable Continue on fail”.
EnableContinueOnFail.png
If the desired element is not found, the test will continue without exception, but the following message will be added to the report:
Report_OptionalAction.png
Regards,
Markus (S)