Within the mabl Trainer, you can add conditional steps inside tests where IF, ELSE, and END steps are available to run groups of steps or flows conditionally. Conditionals can include any number of steps or flows and can also be used within a reusable flow.
While in the mabl Trainer, click the "Add step" plus button in the toolbar at the bottom of the screen.
In this menu, find and click the "Conditionals" option. Now you can begin adding conditional steps.
To form a complete conditional statement, you will need to include all of the following:
You'll need to add an IF statement first. When you select "IF", you'll be prompted to select a conditional to base the statement on, which can be any of the following shown below:
Just like a regular IF statement, whatever conditional you select must be true for the steps within the IF statement to run.
Once the IF statement is added, record steps like you normally would to add them to the IF statement. Once you're finished adding steps, you'll need to add an ELSE and END statement.
After adding your IF statement, you'll need to add an ELSE statement in the event that your conditional is false. Repeat the steps above and select "ELSE" instead of "IF".
You'll see an ELSE step show up in the mabl Trainer now, be sure that it is located at least one step after the IF step. Now you can add whatever steps you would like for the ELSE statement. You can also leave this empty, if you would like.
Now that you have your IF and ELSE statements added, you'll need to add an END statement. Follow the same steps above, selecting "ELSE" instead of the other two options. You'll see the END statement added in the trainer window. Again, be sure this is located after the IF and ELSE statements.
Any steps not executed during a test run due to a conditional will show up in the test output logs as a greyed out step with the indication it was skipped.
Updated 9 days ago