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

How many types of recording modes are there?

600


What is RTM (require ment tracebulity marix) fromate?

1533


Can anyone tell me how i used QTP 9.2 use for GIS based S/w with an example?

1690


On the website, the protocol has been changed https: to https what you will do? Tell me your approach?

584


Explain about datafile/verification of date file when file is not available in local system?

2231






How to test results for qtp ?

789


Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?

561


How to write business scripts using object repository with different scenarios

1390


wht type of User defined functions or Java Releated functions Do we write in VB scripting

1382


i can done the project with QTP in that time i can say how many members in my team size?

1372


Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.

1376


Why to use descriptive programming?

571


What is the extension of qtp local repository?

579


What is the difference between a Function and Action in QTP?

592


what are the challenges you have faced while testing web based application using the automation tools ?

598