Description: This command allows creating an alternative step to execute in case the preceding condition is not met.
Usage Scenario: Suppose we want to add an alternative step to execute if the value of the Birthday text box in our Reference app is not blank.
Procedure: Define a step that retrieves the value of the Birthday text box and define conditional steps that execute according to the result.
Conditions:
1- If the value is empty, fill it with “10.10.1991” and print “Profile has been updated, birthday has been added”.
2- Else, print “Birthday has not been updated because it already exists”.
Your steps will look like this:
See the Test Library path: subject7_samples/subject7_advanced_suite/subject7_modify_profile_information
The following video demonstrates how the “Birthday” is filled in case it is found to be empty as part of execution of “subject7_modify_profile_information” test case in “subject7_samples” folder:
Whereas the following video demonstrates how the alternative step is executed in case the “Birthday” field is not empty. A random value was entered in the field to simulate this scenario.