Answer Posted / 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
♦ Internal
♦ 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 View All Answers
Please Don't mind .i want in detail the real time process i.e in each document what it contains.
I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You
Explain the check points in quicktest professional (qtp)?
what type of run time errors you get while you ar edoing rpg program?
What are the different attribute used with regular expression?
Hi I have exp in manual testing and planning to move in automation testing qtp(9.2).So can help me how to automate customer relationship management tool using qtp and vb script this tool already developed so how can I test it whatever maintaining by development team like documents,various options just give the whole life cycle thanks in advance
Hi. I have completed B.TECH(CS) , But I will go to "SECURITY CONSOLE OPERATING" [C.C CAMERA abservation]. IF interviwer asks " Why you choose this job ?" What we will say? urgent.........................urgent...........
Can anybody let me know how to test the Drag and drop feature of the column in a .net application...eg..i hav to test the drag and drog feature of a table(swftable) in a application..plze help!!
in a web page How to check and display a particular word from a paragraph?
hi i want license key for qtp 9.2 pls its adjust product name : quick test professional locking code :8 - 54A6A license type : seat license maintenance number : 88888888-8888 pls send license key to my email id borusu.ramkumar@gmail.com
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
Please guide me release notes of Automation once scripts are completed
How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")
before launching qtp, we need to close all the open browsers u dont know what are all the browsers either it might be ie,mozilla etc and u dont know how many brosers are open.... u need to close all these before launching qtp.. can anyone plz temme d solution...
What is the difference between Keyword Driven test and Data Driven test?