# 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.&#x20;

These include:

* IF Statement
* IF-Else Statement

***

### If Statement

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

<figure><img src="/files/lktoEAWFXGQiyq1pPwLR" alt=""><figcaption></figcaption></figure>

#### 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.

<figure><img src="/files/dUxLyGtG5fXjlMxVxILZ" alt=""><figcaption></figcaption></figure>

4. 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.
5. Description: Provide a brief explanation.
6. Click Save to apply the condition.

<figure><img src="/files/FCyu0TjxecMvQ6XW9oCP" alt=""><figcaption></figcaption></figure>

7. 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.

<figure><img src="/files/mvqZ2JWAKS97d5P1tvIK" alt=""><figcaption></figcaption></figure>

3. Define the alternate steps to execute if the condition is not met.
4. Click Save.

#### Example:

* Condition: If the login attempt is successful
  * Action: Redirect to the homepage
* Else: If login fails
  * Action: Show an error message

{% hint style="success" %}
**Additional Information**

#### Types of comparison operators supported are:

* Equals to (==)
* Not Equals to (!=)
* Greater than (>)
* Less than (<)
* Greater than or equals to (>=)
* Less than or equals to (<=)
  {% endhint %}

### Frequently Asked Questions (FAQs)

<details>

<summary><strong>Can I nest IF Statements inside another IF Statement?</strong></summary>

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

</details>

<details>

<summary>What happens if I don’t define an Else block?</summary>

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

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.simplifyqa.ai/introduction-to-test-management-in-simplifyqa/conditional-statements/decision-making-statement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
