Global variables are persistent data elements that maintain a consistent value across an entire project. They are particularly useful when sharing data among test cases, reusable components, Gherkin Scenarios, elements, items in the Service Repository, or within a Suite.
Global variables include two types: user-defined, created by users based on their needs, and system-defined, generated by the system but assignable by users.
To create a Global variable for the project, follow the steps mentioned below:
Login to the portal.
Navigate to the Tools Menu on the left panel of your Project Workspace.
The Global Variable window opens. Click on the “+” icon to add parameters.
The Default Browser and Default Mobile Device are the two system-defined Global variables that will exist in each & every project (even in a new project.) Click Add.
A new row gets added to the User-defined Global Variable list. The Name field marked with * is mandatory.
The string is the default Data type for a Global variable, but the user can choose a suitable data type for it by clicking on the Data Type cell.
You have the option to see where a specific Global Variable has been linked to. To do this, pick the Global Variable and press the "UsedBy" button. The "Used By" panel will display the name, complete path, description, and type of component of the artifact that uses the chosen Global Variable.
Global Variable Encryption
This is an advanced feature of Global Variable which allows the users to generate global variables with encrypted values utilizing the Secured String Data Type.
When these Global Variables are established in their encrypted form, their actual values remain concealed from users. The values can be decrypted by giving a decryption password set in Admin at the project level.
To create Global variables with encrypted values, Select the Secured String from the Data Type Dropdown and enter the value as shown below:
This Encrypted value cannot be edited. However, if you wish to edit or view value in the decrypted format then, click the Decrypt value icon. It will decrypt the value [provided there is no encryption password set at the project level.
If an encryption password is configured at the project level, a pop-up window appears. You are required to input the encryption password and then click the OK button.
After the Execution is finished, you can choose to decrypt the values. To do this, click on the Decrypt Result icon. If there's an encryption password in place, you'll be prompted to enter it.
You can also Export the result in Encrypted or decrypted format for the Detailed report.
Changing Values of Global Variables at Runtime:
You can change the value of the Global variables at runtime. To do so, opt for the Global Variable tab on the Run Wizard, and select dropdown. Select any global variable whose value has to be changed.
It will update and proceed accordingly.
You now know how to work with Global Variable.
To learn about more features click Here.
Was this article helpful?
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
We appreciate your effort and will try to fix the article