Decision Making Statement

Decision Making Statements are essential for automating test execution by enabling dynamic decision-making. They help control the flow of execution based on specified conditions, ensuring that the test behaves differently under different scenarios.

These include:

  • IF Statement

  • IF-Else Statement


If Statement

The If Statement executes a specific action if a given condition is met.

How to Create an IF Condition in SimplifyQA?

  1. Navigate to the test case and click on "Add Step" Dropdown.

  2. Choose the 'IF Condition' block.

  3. Click on the condition icon to define the condition and parameters.

  1. Define the parameters:

    1. Add Parameter: Type '#' to select the object or type '/' to select a parameter.

    2. Operator: Choose the comparison type (e.g., equal to, greater than, contains).

    3. Parameter: Set the expected value.

  2. Description: Provide a brief explanation.

  3. Click Save to apply the condition.

  1. Specify the steps within the IF block to execute if the condition is met.

Example:

  • Condition: If the login status is "Success"

  • Action: Proceed to the dashboard.


IF-Else Statement

The IF-Else Statement executes one action if the condition is met and another action if it is not.

How to Create an If-Else Condition in SimplifyQA?

  1. Follow the same steps as for the IF Condition.

  2. After defining the IF Condition, add an ELSE Condition.

  1. Define the alternate steps to execute if the condition is not met.

  2. Click Save.

Example:

  • Condition: If the login attempt is successful

    • Action: Redirect to the homepage

  • Else: If login fails

    • Action: Show an error message

Frequently Asked Questions (FAQs)

Can I nest IF Statements inside another IF Statement?

Yes, you can use nested IF Statements to evaluate multiple conditions within another IF block.

What happens if I don’t define an Else block?

If the condition is false and there's no ELSE block, then the steps outside the conditional statement would get executed (if any).

Last updated