WHAT IS ENVIRONMENT VARIABLES?

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


Please Help Members By Posting Answers For Below Questions

Explain different recording modes?

676


Explain how qtp identifies object?

715


What is the default object synchronization timeout in qtp?

743


What ate the Technologies supported by QTP?

762


Get the count of files of similar types from a folder.

1075






What is an object repository?

709


What is action split and the purpose of using this in qtp?

623


How can we conduct U-I Testing by using QTP??????

1522


How to create scenario selector

1583


Explain in brief about the qtp automation object model (aom).

642


What is data driver in qtp?

659


How to start recording using quicktest professional (qtp)?

689


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

2057


is it possible to add sheets to excel at runtime

3404


Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1422