Create Constant Variable

This is a pre-built Action located under the @Generic Element. The functionality of this Action in Avo Assure is to create a constant variable, assign the value provided in the input value column, and use it when a fixed value must remain unchanged throughout the test execution. The execution result is stored in the given dynamic variable.

Syntax

Input Value: <Constant Variable>;<Value>

Note:

  • Variable name should be enclosed between underscores. For example: _var_.

  • A constant variable in Avo Assure stays the same throughout the execution at the Project Level.

  • If the test step tries to modify the value of a constant variable, then the test step will fail.

  • If the constant variable is not already created but is used in the Output Value field, Avo Assure creates the constant variable with the name given by the user and stores the test step result in it.

Argument
Description

<Constant Variable>

(Required)

Provide the name of the constant variable you want to create.

<Value> (Required)

Provide the value you want to store in the constant variable. Supported variables are:

  • Number

  • String

  • Alphanumeric

  • Special Characters

  • URL

Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Both dynamic variables store the status as True or False.

Example 1: Creating a Constant Variable with a Fixed Value

In this example, we explain how to create a constant variable that remains unchanged during the entire test execution.

  • Action: Create Constant Variable

  • Input Value: _AppURL_;https://avotestlab.avoassure.ai

    • The first argument (_AppURL_) specifies the name of the constant variable.

    • The second argument (https://avotestlab.avoassure.ai) specifies the value of the constant variable.

  • Output Value: {Status}

    • The execution status of the action is stored in this {Status} dynamic variable with the following possible values:

      • True: If the constant variable is created and assigned successfully.

      • False: If the variable creation fails due to invalid input or format.

Note: If you do not define an output variable, Avo Assure displays the result only in the execution logs and does not store it in any variable.

  • Logical Explanation: The Create Constant Variable action fetches the value from the Input Value column (_AppURL_;https://avotestlab.avoassure.ai). It creates a constant variable named (_AppURL_) and assigns the value (https://avotestlab.avoassure.ai) to it. The execution result is stored as (True) in the {Status} variable.

Knowledge Bites:

Here are some examples of different variable scenarios:

Variable
Input Value
Result

Text Variable

_Username_;Admin

True

Numeric Variable

_OTP_;35629

True

Alphanumeric Variable

_EmpID_;OJ1002

True

Wrong Input Variable

__Password__;Admin@12

False

Last updated

Was this helpful?