Using Global Variables in Test Cases and Functions

You are here:
< All Topics
Overview

TestGrid empowers testers with advanced testing capabilities, enabling a single test case to be executed across multiple browsers without modifying the test case. This ensures maximum code coverage with fewer test cases, optimizing time and resources.

By introducing global variables for test cases and functions, TestGrid further enhances the testing experience. Testers can define reusable global variables, simplifying test management and improving consistency across test scenarios. Codeless execution allows users to create, execute, and maintain tests without writing any code, making them accessible to all users.

The primary goals of these features are:

  • Enhanced Efficiency: simplify test creation, execution, and management with codeless functionality and reusable global variables.
  • Improved Consistency: Use global variables to maintain uniformity across test cases and functions.
  • Cost and Effort Optimization: Reduce the time, effort, and complexity of test case execution.
  Prerequisites :

 Login credentials for TestGrid

Step 1: How to Use and Add Global Variables in Codeless Testing.
  • Create a project and corresponding test suites.
  • Navigate to the desired test suite’s version.
  • Locate the “Global Variables” option below the “Custom Libraries” section.
  • Click on “Global Variables.” An “Add Variable” button will appear.
  • Click on the “Add Variable” button to define and save your global variables.

 

 

Step 2: Add the required global variables for your scenario.

a) Define your global variable with a unique name and value.

b) Click on “Add Variable” to save the global variable in the test suite version.

 
Step 3: Edit and delete global variables.

a) To edit a global variable, click on the edit icon next to the variable. Make the necessary changes and save them.

b) To delete a specific global variable, click on the delete icon next to the variable.

c) To delete selected global variables at once, click on the top “Delete” button.

 

Step 4: Using Global Variables in Test Case Generator.

a) Open the test case (TC) in the Test Case Generator where you want to use the global variable.

 

 

b) Use the global variable in both test cases and test functions instead of hardcoding values.

 

Supported Variable Types:
  • Integer: For numerical values without decimal points.
  • String: For text-based values (e.g., names, identifiers, or alphanumeric data).
  • Double: For numerical values with decimal points.

 

Notes:

Our tool supports only Integer, String, and Double as global variable types, which can be used in test cases, test functions, and custom expressions.

 

After Running the Test:

Check the logs to see that the global variables have been applied and worked correctly during the test.

 

 

Happy Testing!!!

 

 

Table of Contents