If

This action in Avo Assure is available under the @Generic Element. Its functionality is to evaluate whether the specified condition is satisfied and to store the result in a dynamic variable.

Syntax

Input Value: (<operand1>;<operator>;<operand2>)

Argument
Description

<operand1> (Required)

Specify the first value to compare against operand2. This can be a static value or a dynamic variable. Supported input formats:

Number and String

<operator> (Required)

This is the comparison operator.

Supported operators include:

>, <, ==, >=, <=,!=, in, not in along with the logical operators AND, OR, NOT.

Note: The operators are case-sensitive.

<operand2> (Required)

Specify the second value to compare against operand1. This can be a static value or a dynamic variable.

Supported input formats: Number and String

Note: While using an If action Test Step, the user must close it with the EndIf Action.

Output Value:

Argument
Description

<NA>

Not Applicable

Example 1: Validating a Condition based on Variable Value

In this example, we explain how to evaluate whether the value stored in a variable meets a specific condition.

  • Action: If

  • Input Value: ({Salary};>=;20000)

    • The variable, {Salary}, specifies the variable containing the value, which serves as the operand to be evaluated. In this scenario, the variable value (salary) is 90000.

    • The operator, >=, defines the operator. This operator checks whether the value of the variable {Salary} is greater than or equal to the specified value (20000)

    • The Number, 20000, specifies the value against which the variable (operand) is compared.

  • Logical Explanation: The If action takes the value from the Input Value column ({Salary};>=;20000) and checks whether the value 90000 stored in the {Salary} variable is greater than or equal to 20000. If the condition is true, the actions inside the If block are executed. In this scenario, the Display Variable Value action displays the value of the {Eligible} variable (Eligible for Loan). If the condition were false, the execution would proceed to the next steps outside the If block.

Note: For better understanding, refer to the screenshot below.

Example 2: Verifying String Presence

In this example, we explain how to evaluate whether the value stored in one variable exists within another string or variable.

  • Action: If

  • Input Value: ({Full Name};in;John Doe)

    • The variable, {Full Name}, specifies the variable containing the value, which serves as the operand to be evaluated. In this scenario, the variable value (Full Name) is John Doe.

    • The operator, in, defines the comparison operator used to check if the value exists within another string or variable.

    • The string, John Doe, specifies the string (operand) in which the search will be performed.

  • Logical Explanation: The If action takes the value from the Input Value column ({Full Name};in;John Doe) and checks whether the value stored in {Full Name} (i.e., John Doe) exists within John Doe. If the condition evaluates to true, the actions inside the If block are executed. In this scenario, the Display Variable Value action displays the value of the {Name} variable (John Doe). If the condition were false, the execution would proceed to the next steps outside the If block.

Note: For better understanding, refer to the screenshot below.

Example 3: Verifying Absence of a Value

In this example, we explain how to evaluate whether the value stored in a variable does not meet a specific condition.

  • Action: If

  • Input Value: ({Full Name};not in;James Anderson)

    • The variable, {Full Name}, specifies the variable containing the value, which serves as the operand to be evaluated. In this scenario, the variable value (Full Name) is John Doe.

    • The operator, not in, defines the operator used to check whether the specified value is not present within another string or variable.

    • The string, James Anderson, specifies the string (operand) in which the search will be performed.

  • Logical Explanation: The If action takes the value from the Input Value column ({Full Name};not in;James Anderson) and checks whether the value stored in the {Full Name} variable (i.e., John Doe) is not in the string James Anderson. If the condition evaluates to true, the actions inside the If block are executed. In this scenario, the Display Variable Value action displays the value of the {Name} variable (John Doe). If the condition were false, the execution would proceed to the next steps outside the If block.

Note: For better understanding, refer to the screenshot below.

Last updated

Was this helpful?