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
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
how u will evaluate the tool for test automation?
desribe a situation where u faced a stressful situation and how did u cope with it
Mention what are the different types of recording modes in qtp? Which will be used when?
Explain the features of quick test pro(qtp)?
What is recovery scenario manager? When you go for recovery scenario manager?
I need Major Help with a Script I recorded in QTP 9.5. I am recording scripts for a Web-based application(s) I have all the URLs for each application in Excel spreadhsheet so that QTP can pull that particular application from the spreadsheet and run it. The problem is QTP isn't recognizing one particular URL so when I hit run in QTP to run this script it opens the internet Explorer but isn't open the URL I have in the Excel spreadsheet. I've retyped the URL and still QTP won't open this Particular one for some reason. The site its self is working fine but for whatever reason QTP won't open it. How do I resolve this? I have a deadline of next Friday the 7th to complete this task so please help me in any way you can. Thanks in advance
How to handle dynamic objects in quicktest professional?
how we implement share object repository in QTP 9.0 without using quality Centre , Explaine in brief
Hi All, issue is related to handling pop up script generated in IE, and run on mozilla. In App Under Test, when we get the alert pop ups, we just click ok button. if we need to run the same code on mozilla it will not identify . so we will check browser if browser(*).dialog(IE object).exits browser(*).dialog(IE object).winbutton(OK).click else 'by default mozilla browser(*).dialog(mozilla object).page(*).webbutton(OK).CLICK END IF But my qustion is. Do we write the above piece of code where ever we get such kind of pop ups from the application like alert pop up, confirmation pop up.... OR do we have any other alternative way to do this by using any functions in Recovery Scebarios? If Any of u know idea please do help me in this regard. or send answer to kravimb@gmail.com
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.
please post the interview questions for QA position in FACTSET
What is file database?
Why to use descriptive programming?
While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?