Hi again
We have an upcoming application for both Android and iOS. When a user has the free version and goes to the main screen a full page advert can be shown which can be closed by tapping a big X. The problem is that the ads are random and based on locations etc.
Is there anyway to do an 'IF' clause within the recorded project? So that 'IF' the advert shows, to exit the ad, and if not then to continue?
Probably an easy question, but still in evaluation stage.
Thanks
Tony
Able to place an 'IF' clause during recording?
Re: Able to place an 'IF' clause during recording?
Hi,
I'm afraid, there is no way to create conditional statements during recording the test. The only way to add "IF" statement to (existing) recording is to convert the affected actions to User Code and then add "IF-ELSE" statement to that user code. Simple select the rows in recording, right click the selection and from the appeared menu select "Merge Items to User Code Item". Then you can edit the User Code in UserCode.cs.
I'm afraid, there is no way to create conditional statements during recording the test. The only way to add "IF" statement to (existing) recording is to convert the affected actions to User Code and then add "IF-ELSE" statement to that user code. Simple select the rows in recording, right click the selection and from the appeared menu select "Merge Items to User Code Item". Then you can edit the User Code in UserCode.cs.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 65
- Joined: Wed Sep 24, 2014 7:47 am
- Location: Israel
Re: Able to place an 'IF' clause during recording?
As stated before , user code is one way.
another way to enter a step that clicks on the ad, but use the menu to make it an optional step. If it succeeds (ad appeared) the recording goes on.
if it didn't find the ad, then the step fails, but the recording goes on (since it is optional).
another way to enter a step that clicks on the ad, but use the menu to make it an optional step. If it succeeds (ad appeared) the recording goes on.
if it didn't find the ad, then the step fails, but the recording goes on (since it is optional).
Re: Able to place an 'IF' clause during recording?
The problem with using [Continue on Failure] or [Optional] is that it still puts a failure in the test, even though it may not be a failure. Some of us only want to see failures in the report when validations fail.
The use of user-code is the best method as it allows you to describe exactly what situations you want to look for and handle without throwing exceptions (failures), and then validate accordingly.
The use of user-code is the best method as it allows you to describe exactly what situations you want to look for and handle without throwing exceptions (failures), and then validate accordingly.
Shortcuts usually aren't...