Insert a Conditional Block in Test Steps
You can insert a conditional block in the test script. A conditional block allows the script to perform a test and then take action based on the result of that test. Hence, the execution of the successive steps depends on the result of the condition inserted in the previous step. If the defined condition is passed, the next step will be performed. Else, the next step will not be executed.
For example,
A test script is recorded to debit the amount from the bank site. Now, you want to insert a condition that the amount will be debited only if there is a certain amount in credit.
Steps
1. Open the test case to view the recorded steps.
2. Select the step where you want to insert the conditional block and open the Create drop-down at the top and select the Conditional Block option.
Alternatively, select the step where you want to insert the conditional block and right click on the step, and select the Conditional Block option.
The Conditional Block section opens with fields on it.
3. Enter the following details:
Name: Give a name to the Conditional Block that is being inserted in the test script.
Payload: Write the script describing the condition you want to pass. If this condition passes, then only the successive step will be executed.
4. Click Create.
The condition gets inserted. You can also view the Payload on hover over.