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
Explain different recording modes?
Explain how qtp identifies object?
What is the default object synchronization timeout in qtp?
What ate the Technologies supported by QTP?
Get the count of files of similar types from a folder.
What is an object repository?
What is action split and the purpose of using this in qtp?
How can we conduct U-I Testing by using QTP??????
How to create scenario selector
Explain in brief about the qtp automation object model (aom).
What is data driver in qtp?
How to start recording using quicktest professional (qtp)?
what is the difference betn QTP 8.0 AND PREVIOUS VERSION
is it possible to add sheets to excel at runtime
Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji