-->Environment Variables

Inorder to execute the QTP script on any of the particular environments, we need to edit the values of the variables like URL, Userid, Password, etc. So, it is better to maintain in a separate file rather than maintaining them in the script. And these variables are called environment variables.

Different Types of Environment Variables:

1. Built-In Environment Variables
2. User Defined Environment Variables
Local Environment Variables
Global Environment Variables
.ini format
.xml format

Built-In Environment Variables:
We can find all the built-in environment variables from the location:
File -> Settings -> Environment Tab -> Select the variable type “Built-In”.

Syntax to read the value of the variable:
Environment.Value(“Variable Name”)
OR
Environment(“Variable Name”)
Eg: EnvVal= Environment.Value(“OS”)
msgbox EnvVal
OR msgbox Environment(“OS”)