Global-&-Environment

Global Variable

Global variables offer a streamlined way to simplify test maintenance. They are basically variables that can be created once and reused any number of times across the same project.

By creating multiple "Environments" or profiles, users can manage distinct global variables. These variables can then be referenced across any Test Script within the project.


Get started with Global variable:

Step-1 : Select a project.

Step-2 : Under any Functional, Performance or API Process service, click on Project Setup.

Step-3 : Under Project Setup, click on Global Variables.

Step-4 : There will be a list of all the Global variables or if not we can create as required.

Step-5 : Click on New Variable & add the variables accordingly.

Step-6 : Provide Variable name.

  • Note: Global variable name can contain only underscore as a special character other than this no special characters are allowed. Make sure the name which you are going to give is unique across all global variables and dynamic variables which are present in the same project.

    Good usecase

     First_name_usn_001
     or
     First_001
     or
     first_Name_123
     or
     firstName

    Bad usecase

     _first_name_001
     or
     first#name_usn$001
     or
     $first_name

Step-7 : Select the Type of the variable from the drop down available, and add the Variable value.

Types:

  1. Integer: Generates a random integer value between the minimum and maximum values entered.

  2. Decimal: Generates a random decimal value between the minimum and maximum values entered and the decimal count defines the number of decimal point after the integer value.

  3. UUID/GUID: Generates a random UUID/GUID value for the variable entered.

  4. Email: Enter a valid e-mail address that can be used.

  5. Date: Enter a date in the valid format that can be used.

  6. Custom: As the name says, the value can be of a custom type and can be used a global variable.

  7. Firstname: Enter a first name that can be used.

  8. Lastname: Enter a last name that can be used.

  9. Password: Enter a valid password that can be used.

Step-8: Click on Save button.


Editing a Global Variable

Step-1: Within the Global Variable section, find the variable you wish to edit.

Step-2: Click on the variable's Edit button.

Step-3: Once you've made the necessary modifications to the variable, proceed by clicking on the "Update" button.

Deleting a Global Variable

Step-1: Within the Global Variable section, find the variable you wish to delete.

Step-2: Select the Delete button linked with that variable.

Step-3: Confirm the deletion.

Environment

User can now create environments and variables under that; This can be done across all the environments and select the particular one while execution. The default environment will be called as “Global”.

To begin with Environment:

Step-1: Under Project Setup click on Global Variables; this will display Global variable creation page.

Step-2: Click on Create Environment icon & Create Environment tab will get displayed.

Step-3: User can enter a Environment name and click on Create button, a New Environment will get created.

Step-4: The newly created environment will be displayed in the dropdown.

Step-5: User should select the Environment from the dropdown to Create the Variables under selected environment.

Clone Environment

Step-1: There is an option to clone the Variables from one environment to another environment.

Step-2: Upon clicking on clone icon the Clone Environment tab will get displayed.

Step-3: User can select the Environment into which the variables needs to be cloned.

Step-4: Then select environment from the dropdown & click on the Clone button.


Edit Environment

Step-1: Under dropdown, list of all environment will be displayed.

Step-2: Select any other environment apart Global, User will be able to Edit the Environment.

Step-3: Click on Edit icon & Edit Environment tab will get displayed.

Step-4: An user can do modification and hit Edit button.


Delete Environment

Step-1 : Under dropdown, list of all environment will be displayed.

Step-2 : Select any other environment apart Global, User will be able to Delete the Environment.

Step-3 Click on Delete icon & Delete Environment tab will get displayed.

Step-4: An user can confirm deletion hitting Delete button.

Note

  • When user selects the environment as Global, it will not allow the user to Edit or Delete Environment.


Global Variables in Fuctional, Performance & API Process :

Global variables can be used throughout the project in functional, performance & API process testing in API.

Step-1: Select a Project → Functional Testing or Performance or API Process → In the test suites page, click Project Setup.

Step-2: Create new variable or use an existing variables.

Step-3: Create an API and add the global variables as shown below.

Note:

  • The global variable can be used in any field, not restricted to only body.

  • While adding a variable, always add a '#' symbol to the start and end of global variable. So now, the global variables get replaced by the value that was defined in Global Variables.

Step 4: Save the API, click on Run button to execute the API and then navigate to the reports page to view the result.

  • As we can see in the above snapshot, the global variables have been replaced with the actual values and a successful response is obtained.


Keyboard Shortcuts

→ Keyboard shortcuts are combinations of keystrokes that allow you to quickly perform an action. They are useful and often great time-savers. This page includes a guide to a few useful combinations that will help you complete tasks more quickly.

  • The API Testing Keyboard Shortcuts lists for Global Variable Page:

    • Ctrl + A → Add new Variable

    • Ctrl + S → Save Variable

Note:The Mac user can use the Cmd key also in order to use shortcuts.


Last updated