skip to Main Content

Session/Suite Variables

Tabular view :

Card view :

 

 

Session variables are similar to Local variables except that their scope spans the whole suite i.e. all the cases within a suite. For example, if a set of cases require Current Date as a test input, one can define a date variable at the suite level and reference it in all the cases as opposed to getting the date every time.

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 below snapshot.

Tabular view :

Card view :

                                                       Here, $S is used in order to indicate that this is a suite level variable.

It creates a suite level variable named “currentdate” with value as “1/1/2020” and the scope of the variable is limited to complete suite. If there are 10 cases in the suite, then user can define a suite variable in case 1 and can use it in any case from 2 to 10.

Note: Case containing a suite/session variable must be executed prior to cases seeking that particular session/suite variable value.

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

Syntax: ${variable name} Example: $S{currentdate}

Tabular view :

Card view :

 

 

Back To Top