Global Variables

Global variables are also known as predefined or initial variables. These variables are defined before the execution of test cases. A good example will be "baseURL" and it can be used in all the test cases. Each project in vREST will have their own set of variables. Further these global variables are grouped under Environments. Few points regarding environments:

  1. A 'Default' environment is always available in each project. User can define any common variables in this environment.

  2. For multiple environments like dev, staging, qa, prod etc., user can define custom environments for each.

  3. Custom environment inherits and overrides all the variables from Default environment.

To define a global variable / environment, follow the steps below:

  • Go to the Configuration Tab, in vREST NG application, and Click on Environments / Variables section.
  • Now select the appropriate environment in which you would like to define the variable. If you are not sure, select "default" environment.
  • Now, you can add multiple variables to the selected environment by clicking on and filling in the details (key and value).

Now you may use the above variable in the test case by using the format {{VARIABLE_NAME}}.