What can we help you with?
< All Topics
Print

Variables

What is a Variable?

Variables are the elements that are used to store the data that can house different values and be utilized within a script or a project which avoids data hardcoding.

What is the use of a Variable?

  • Variables created are used to pass the value in the step, for the execution.
  • It avoids the re-work when the value changes.
  • To reuse the values at multiple places.

Types of Variables:

  1. Local Variables: The local variables can be accessed only to those steps created under a particular script.
  2. Global Variables: The global variables can be accessed to the sub-modules and scripts present under the parent module.
  3. Project Environment Variables:
    1. The project environment variables can be accessed for all the modules, sub-modules, and scripts present under that project.
    2. The “Assign Step return value to”, the project environment variable cannot be created through the “Add” icon, or accessed through the “$” symbol in “NLP input parameter div”.
    3. The value which is given while creating a project (For Web URL, App activity, and App package) will be stored in the project environment variables, by default.

      NOTE 1: If the “Variables” tab is routed through a module or sub-module, the variable options displayed in the dropdown are “Global Variables” and “Project Environment Variables”.

      NOTE 2: If the Variables tab is routed through scripts, the variables options displayed in the dropdown are “Local Variables”“Global Variables” and “Project Environment Variables”.

      NOTE 3:: The variables which are used for the “default” step groups like “Open browser” and “Close browser” will be stored under “Global” and “Project environment variables”. These variables are not allowed to “Edit” or “Delete” by the user, the “Edit and “Delete” icons will be disabled.

Navigation for Variables screen

Home icon > Test Development > <<Module name>> > <<Script name>> > Variables

Pre-requisites

Before creating a variable, a “Module” and a “Script” should be created.

Scenarios to add “Variables”:

There are two ways to add variables:

  • In the steps screen, on clicking the “More Actions” icon, the context menu displays. Select the “Add a Variable” option in the list, “Create Variable” pop-up appears.
  • In the variables screen, on clicking th“+Variable” button, the “Create Variable” pop-up displays. The “Create Variable” popup is explained in detail below.

Columns present under the “Local Variables” table:

  • Name: In this column, the name added while creating a variable is displayed in the table in the “Create Variable” pop-up.
  • Value: In this column, the value-added while creating a variable, in the “Create Variable” pop-up is in the table.
  • Returning step: here, after execution, the step returning some value (Step number) is displayed.
  • Modified by: In this column, the name of the user who modified the data in the table is displayed.
  • Actions: In this column, the three icons are displayed when hovered with a mouse: the “Edit” icon, the “Delete” icon, and the “More” icon. When clicking on the “More” icon, it will display the “Details” option.

Columns present under the “Global Variables” table:

  • Name: In this column, the name added while creating a variable is displayed in the table in the “Create Variable” pop-up.
  • Value: The value added while creating a variable, in the “Create Variable” pop-up is displayed in the table.
  • Returning step: Here, after execution, the step returning some value (Step number) is displayed.
  • Modified by: In this column, the name of the user who modified the data in the table is displayed.
  • Actions: In this column, the three icons are displayed when hovered with a mouse: “the Edit” icon, “The delete” icon, and “The more” icon. When clicking on the “More” icon, it will display the “Details” option.

Columns present under the “Project Environment Variables” table:

  • Name: In this column, the name added while creating a variable in the “Create Variable” pop-up is displayed in the table.
  • Value: In this column, the value added while creating a variable in the “Create Variable” pop-up is displayed in the table.
  • Modified by: In this column, the name of the user who modified the data in the table is displayed.
  • Actions: In this column, the three icons that are displayed when hovered by a mouse are:
    “Edit” icon, “Delete” icon, and “More” icon. When clicking on the “More” icon, it will display the “Details” option.

How to add a variable in the “Create Variable” pop-up?

  • Enter the name in the “Name” text field. This is a mandatory field.
  • The variable type selected in the dropdown in theVariable tab, is displayed in the “Type” dropdown field in the “Create Variable” popup. This is a mandatory field. There are three types:
    • If the type selected is “Local Variables”, the type is displayed as “Local in the pop-up (By default Local” type is selected in the “Variables” screen).
    • If the type selected is “Global Variables”, the type is displayed as “Global” in the popup.
    • If the type selected is Project Environment Variables, the type is displayed as Project Environment Variable in the popup.
  • Enter a value in the “Value” (non-mandatory) text field.
  • Click on the “Create” button.

Edit and Delete the Variable

1. Edit a Variable

  • Click on the Edit” icon under the “Actions” column. The “Edit Variable <<Variable name>>” pop-up will be displayed.
  • Here, you can edit only the data present in the “Name” and “Value” text fields. The “Type” field is disabled by default in the “Edit” popup.

  • Click on the “Update” button in the popup.

2. Delete a Variable

  • Click on the “Delete” icon present under the “Actions” column.

  • The “Warning pop-up” is displayed.

  • Here, if you click on the “Delete” button in the pop-up, the variable added to the table is deleted from the table.

How to view the details of a “Variable” created?

  • Click on the “More” icon present under the “Actions” column, and click on “Details”.
  • The “Variable Details- <Variable name>” pop-up is displayed.

  • Here, the details like “Name“Value”“Returning Step” (only if the type is “Local” or “Global”), “Created by”, “Created On”“Modified By”“Modified On” is displayed in the pop-up.
Table of Contents