Answer Posted / sheshadri
The following are the uses of Environment variables:
1) Environment variables are used to pass the variables
across the Actions in the Test Script.
For Ex: We can have max of 255 Actions in a Test script.
With the use of normal variables we cannot pass the
variables declared in one Action to another.
But with the help of Environment Variables we can pass the
variables across the number of Actions in a test script.
I will elaborate this with a small example:
Without Environment variables:
Action1:
option explicit
dim a,b
a=10
b=20
msgbox a
Action2:
msgbox b
when you run the script the output of Action1 would be 10
but there will be no output of Action2 (only blank msgbox
will be displayed)
So to overcome such problems we use Environment variables.
The same Ex with environment variables:
Action1:
Option explicit
Dim a,b
a=10
b=20
msgbox environment ("a")
Action2:
msgbox environment ("b")
Now Create the Environment variables by
File-->Settings-->Test Setting-->Environment
Select variable type as User defined then Click on the
"+" symbol Add environment parameter Name=a Value=10
repeat to give the name and value of "b"
Check the "Load variables and values from external file
Click apply and OK and run the script.
2)TO overcome the problems associated with "Hard-coded"
values we use Environment variables.
Hope u find it useful
for further details contact on: sheshadrineela@yahoo.com
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Key word driven framework
Explain advantages and disadvantages kdf?
How do we analyze the checkpoint results?
What is the difference between analog and low level recording?
Write a script to verify font style and color of a windows object using descriptive programming
Explain different types of action in qtp?
Hi, How Accessibility checkpoint in QTP can be implemented in the test script?
i'm using the qtp to test to vb appliction,i wanted to get the new application's title.i didn't want to use the winAPI to get it ,i 'd like to know whether a QTP function can do it. Eg: SystemUtil.Run "C:\Program Files\.....","","","" 'run an application, and misure the application is activating,then how to get the hwn wihtout using windowns api
Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..
How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box
Explain about Test Fusion Report of QTP?
What is the short cut keys for the following?
We stored into the objects OR and then write the scripting
How to give a call to another action from one action?
action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans