Else-If
This is a pre-built Action located under the @Generic Element. The functionality of this action in Avo Assure is to evaluate whether the specified condition is satisfied. If the initial If condition fails, the Else-If part is executed as an alternative conditional part. The result is stored in the given dynamic variable for further use during test execution..
Syntax
Input Value:(<operand1>;<operator>;<operand2>)
<operand1> (Required)
Provide the first value which you want 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)
Provide the second value which you want to compare against operand1. This can be a static value or a dynamic variable.
Supported input formats: Number and String
Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)
<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)
Both dynamic variable stores the status as True or False.
Example 1: Evaluating an Additional Condition When the Initial If Condition Fails
In this example, we explain how to evaluate another condition when the first If condition does not meet the defined criteria.
Action: Else-If
Input Value: ({Income};==;60000)
The variable ({Income}) specifies the dynamic variable whose value is being evaluated. In this scenario, the value stored in the {Income} variable is 60000.
The operator (==) defines the comparison rule. This operator checks whether the value of the variable {Income} is equal to the specified number (60000).
The number (60000) specifies the threshold against which the {Income} value is compared.
Output Value: {Status}
The result of the evaluate operation is stored in the {Status} dynamic variable with the following possible values:
True: If the Else-If part executes successfully.
Fales: If the Else-If part does not execute because the If condition is fulfilled.
Logical Explanation: The Else-If action evaluates the condition defined in the Input Value column (({Income};==;60000)), but only after the initial If condition evaluates to false. In this scenario, the value stored in the {Income} variable is 60000, which satisfies the condition. If the condition is true, the actions inside the Else-If block are executed. In this scenario, the Display Variable Value action displays the value of the {TaxRate2} variable (20%). The result of the evaluation operation (True) is stored in the {Status} variable.

Example 2: Verifying String Presence When the Initial If Condition Fails
In this example, we explain how to evaluate whether the value stored in one variable exists within another string or variable, but only when the previous If condition evaluates to false.
Action: Else-If
Input Value: ({Department};in;Technology)
The variable ({Department}) specifies the variable containing the value to be evaluated. In this scenario, the value stored in the {Department} variable is Technology.
The operator (in) defines the comparison operator used to check whether the value from the dynamic variable exists within another provided string or variable.
The string (Technology) specifies the exact string in which the search will be performed.
Output Value: {Status}
The result of the evaluate operation is stored in the {Status} dynamic variable with the following possible values:
True: If the Else-If part executes successfully.
Fales: If the Else-If part does not execute because the If condition is fulfilled.
Logical Explanation: The Else-If action evaluates the condition provided in the Input Value column ({Department};in;Technology). When the initial If condition has already failed. It checks whether the value stored in the {Department} variable (Technology) exists within the comparison string Technology. In this scenario, the value matches, so the Else-If condition evaluates to true, and the steps inside the Else-If part are executed. If the condition were false, execution would move to the next Else If block or end the loop part.

Last updated
Was this helpful?