Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


WHAT IS ENVIRONMENT VARIABLES?

Answers were Sorted based on User's Feedback



WHAT IS ENVIRONMENT VARIABLES?..

Answer / nanda

Sreeprasad is little right but not completely in my way...

he is right up to his answer..

he didnt say main use..

Environment variables are mainly used to know information of
run after completion of execution...and to pass the
variables from system configuration..

for examples...

If we are doing parameterization and after completion of
execution we want to know how many iterations were executed
and in each iteration what are the values were taken..we can
see them with out going results window and by writing
notepad file and using built in environment variables.

for this we create a folder for each test and we create text
file for each action..we will write these information in
notepad files.

For more information about this mail me@
nanda.dreddy@gamil.com

Is This Answer Correct ?    3 Yes 0 No

WHAT IS ENVIRONMENT VARIABLES?..

Answer / sreeprasad

the variable which you have in one action cant be used in

some other action .so by using environment variables we can

use the variables in one action in to another action.

environment variables are 3 types,

(1). user defined internal

(2). user defined external

(3). builtin

Is This Answer Correct ?    4 Yes 2 No

WHAT IS ENVIRONMENT VARIABLES?..

Answer / 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

WHAT IS ENVIRONMENT VARIABLES?..

Answer / babu

Hi,
File->Setting->Environment
Selected User defined functions and added the variables "a"
with value 10 and "b" with value 10.
click on apply
open new test.
Dim c
c = a+b
msgbox c
I am not getting the result as 20.

Whether the scenario what i executed is wrong.
If yes, please elaborate how&what is the use of environment
variables.

Is This Answer Correct ?    0 Yes 0 No

WHAT IS ENVIRONMENT VARIABLES?..

Answer / venkat

c=Environment("a"")+environtment("b)
msgbox c

Is This Answer Correct ?    0 Yes 0 No

WHAT IS ENVIRONMENT VARIABLES?..

Answer / deven

Environment variables in QTP are similar to global
variables which can be accessed through any part of the
script.These variables can prove to be very useful when we
want a variable to be shared across various reusable
actions and functions.

Two Types of Environment variable:

1. Built in variables

2. User Defined variables
&#9830; Internal
&#9830; External


Built in variable:

Built-in: Variables that represent information about the
test on which the test is run, such as Test path and
Operating system. These variables are accessible from all
tests, and are designated as read-only.

Syntax:

Variable = Environment("environment variable name")

Example:

'Some of the In built Environment Variables

Msgbox Environment("OS")
Msgbox Environment("OSVersion")
Msgbox Environment.value("ProductDir")
Msgbox Environment.value("ProductName")

'path where Test result for the current test is stored
Msgbox Environment("ResultDir")


Internal User defined variable:

User defined Internal: are the variables that we define
within the test.The variables are saved with the test and
are accessible only within the test.

Example:

'User can create their own enviroment variables like "Url"

Environment.Value("Url")= "http:\\www.gmail.com"

URL=Environment.Value("Url")

Systemutil.Run "iexplore.exe",URL

External User defined variable

User defined External: are the variables that we predefine
in the active external environment variables file.These can
be created using a list of variable-value pairs in an
external file in .xml format.

Steps to follow:


1. Create External user defined variable

File --> settings --> Environment --> select variable type
as user defined --> click add icon (+) --> enter variable
name & Value --> click OK --> click export --> browse path
and enter file name --> save with xml extension --> click
OK.

2. Associate environment variable file(xml)

File --> settings -->Environment --> select variable type
as user defined --> check “load variables and values from
the external file” --> browse path of the xml file -->
click apply --> Click OK.

XML file with variable name and value should be mentioned

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

how open two urls in one browser? plz urgent

9 Answers   Satyam,


How to modify the text checkpoint?

0 Answers  


What is Associate Repository in QTP 9.2 ?

0 Answers  


HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com

0 Answers  


How can we display the names of the buttons in the toolbar of a webpage

1 Answers  


What is the differences between image check point and bit map check point?

0 Answers  


Hi,EXCEL SHEET AND DATA TABLE . BOTH ARE SAME OR NOT?

3 Answers  


One build is delivered. in that build button name is submit. but in the next buit that name of the button changed as login.are u continue with previous recorded script or u make any changes?

6 Answers   Covansys,


What is the difference between low level recording and virtual object.

2 Answers   Tech Mahindra,


can u tell me website address of VBscript with examples.

2 Answers  


What is expert view and keyword view?

0 Answers  


hi i need to learn qtp its very urgent..pls tell me who is the best faculty for qtp in hyd..... and i plan to go foe mindq nageshwar rao? its good or not?

2 Answers  


Categories