"SET_GLOBAL_VAR" Command

Description: This command creates a global variable and assigns the value to a variable name. Global variables can be used across multiple test cases and can be leveraged in different execution sets/load tests. To retrieve the value of this variable and use it somewhere else, we can use the command GET_GLOBAL_VAR. Encrypted checkbox allows you to encrypt and mask the value from appearing in logs or Variables window.

Usage Scenario: Suppose we want to log into Reference application, retrieve the value that indicates the last time the profile was edited and assign this value to a global variable.

Procedure: Define steps that lead up to the point where the profile Edit screen is visible where the last edit date/time is added in Resume field. Then define a step with Get_Web_Value command that retrieves the value of the last edit. Finally, the Set_Global_Var step will take the value of Get_Web_Value step and assigns it to a global variable. Your steps will look like this:

image-20240610-161700.png

XPath used for Resume field:

//textarea[contains(@placeholder, 'Resume')]

Get_Web_Value step:

 

 

Related pages