Skip to content

Local Variables

Local variables are test-specific. They allow a test to create a variable for holding a data value which can be used as-is in subsequent steps of the same test.

For example, when a test engineer needs to set the value of a Text Field and then in a subsequent step need to confirm that the value indeed matches what it was set to, framework needs to remember what the original entered value was. To accomplish this, tester would first create a local variable with some value. And then in the validation step refer to the same variable to do the match.

Example: tc 555 “Testing Google Search”
set searchtext “HuLoop”

Action/command will be SET, screen name will be blank, variable name will go into Element and its value will go in the parameters as shown in step 2 in above snapshot.

It creates a local variable named “searchtext” with value as “HuLoop” and the scope of the variable is limited to test case 555.

Now, in order to use this variable, user has to use variable name along with the $ sign as given below:

Syntax: ${variable name} Example: ${searchtext}

Tabular View :

Card View :

 

Back To Top