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
Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?
WHAT IS THE DIFFERENCE BETWEEN QTP SCRIPT AND VB SCRIPT? HOW MUCH PERCENTAGE WE USE IN QTP SCRIPT REAL TIME AND HOW MUCH PERCEN OF VB SCRIPT,,,,,,,
Thanks....But can u tell me how i use the QTP for GIS with one Example...
what is profile tool?
Describe function procedure in vbscript.
please give me the code for doing retesting of gmail login page using functions so the function has to give the value
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.
Explain the use of action split in qtp?
Connect to QC using AOM.
Is any limitation to xml checkpoints?
i have doubt suppose iam purly working in QTP, when i will work on sql and performence testing? pls any one clarify doubt?
what is the advantages and disadvantages of using functions instead of re usable actions
Can you brief the hurdles you faced during Automation testing?
What are the methods of the TextStream object that are used for reading from a text file?
What are the methods used in UFT to handle exceptions or run-time errors?