Tuesday, February 8, 2011

Types of environment variables in QTP

There are three Types of Environment Variables in qtp
 1: User-Defined Internal
2: User-Defined External
3: Build-in

1: User-Defined Internal

User defined internal variables are the variables that you define within the test. They are saved with the test and accessible only within the test in which they were defined.

        • In the Edit value section of the Object Properties, Object Repository, Method Arguments, or 
          Checkpoint Properties dialog box, click Other as the type of parameter you want to use.
       • Click the Edit Parameter Options button next to the parameter type box. The Parameter Options

         dialog box opens.
       • Select Environment in the Parameter Types box.
       • Accept the default name or enter a new name to add a new user-definedinternal environment

          parameter, or select an existing environment variable name from the Name box. If you select an 
         existing internal parameter, you can modify the value.
       • If you created a new parameter or selected an existing user-defined-internal parameter, enter the value

         for the parameter in the Value box.
       • Select the Regular Expression check box if needed and Enter the regular expression
       • Click OK to save your changes and close the dialog box.

2: User-Defined External

User defined external variables are the variable that you pre-defined in the active external environment variables file. You can create as many files as you want and select an appropriate file for each test. Note that external environment variable values are designated as read-only within the test.

To define these variables create an external environment variables file
To select the active external environment-variables file:
      • Choose Test > Settings to open the Test Settings dialog box.
      • Click the Environment tab.
      • Select the Load variables and values from external file (reloaded each test run) check box.
      • Use the browse button or enter the full path of the external environment- variables file you want to use
         with your test.

3: Build-in



Built-in variables, such as Test path and Operating system. They are accessible from all tests, and are designated as read-only.
Steps to add or modify environment variable parameters:       

2 comments:

Sunil Kumar said...

Good one neeraj ... It will really help me and others learn QTP in a much better way. Your blog will surely shut all the training centers one day in bangalore who become rich by stealing people's money just for the cause of teaching them automation tools. Which even though they dont ... as you do in a much productive way !!

Neerajkumar said...

Thanks :)