Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18488 Posts in 4838 Topics- by 32654 Members - Latest Member: revitvm
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Environment Variable    (Read 585 times)
nir deka
FRProject
Full User
*
Offline Offline

Posts: 105


WWW
« on: February 21, 2008, 01:56:25 AM »


What is Environment Variable and when we an apply this in QTP?Please tell me the scenarios if possible, when i can go for environmental variables.Huh?

Regards
nir
Logged
yassa
Administrator
Advanced User
*****
Offline Offline

Posts: 879



WWW
« Reply #1 on: February 21, 2008, 08:33:13 AM »

The environment variable is a global variable, holding QTP "system" values, as well as user defined values.

You can access the environment variable from anywhere in your script:

Msgbox Environment("Some Name")

Where "Some Name" is the name of the item you want.
For example:

Msgbox Environment("TestName")

Will print the current test name.

You can easily add new items to the environemnt:

Environment("Some Name") = "Some Value"

We usually use the environment variable in one of two cases:
1. We wish to access some QTP "system" data (e.g. the name of the test). You can see all the system items of the environment variable by going to File->Settings->Environment

2. We wish to store data that will persist and will be available from different actions, iterations and functions.
Logged

Yaron Assa

AdvancedQTP Site Administrator
Pages: [1]   Go Up
Print
Jump to: