<The article below is incomplete currently but would be updated soon with other information. Once updated this message will not appear>
Are you new to HP Quick Test Pro 9.2 (QTP)? Say yes and you are at the right place, at the right time. This article is for newbie’s who want to start their carrier with QTP or have just started with QTP. The article will give you a brief overview of various features of QTP, and since it is for newbie’s we won’t be going into too much details of every feature.
What is QTP 9.2?
HP Quick Test Pro 9.2 is a functional automation and regression testing tool
QTP provides record and playback of events
Uses VBScript as the scripting Language
Provides keyword view and expert view to view test cases.
Latest versions of QTP is 9.5 (launched in mid Jan 2008)
Previous version of QTP: 6.5, 8.0, 8.1, 8.2, 9.0, 9.1
QTP was previously owned by Mercury Interactive®
Installing QTP 9.2
You can download a 14 day Trial version from below link
With introduction of QTP 9.5, Trial version of QTP 9.2 is not available. QTP 9.5 does not have any huge enhancement and hence most of the features discussed in this article will still hold
Launching QTP
When you launch QTP for the first time, Add-in manager window is displayed
What is Add-in?
QTP requires Add-in for recognizing object of a specific environment
By default QTP 9.2 comes with 3 Add-ins: Web, ActiveX and VB
Some of the Add-ins available for QTP 9.2 are
Terminal Emulator (TE)
.NET
Java
SAP
Siebel
Stingray
VisualAge
Web Services
QTP does not require any Add-in to work on Standard windows application
Add-ins can only be loaded when starting QTP
Once the selected Add-ins are loaded, QTP window will show up
Hit the record button to start recording. If you are recording for the first time, the Record and Run Settings dialog box opens as shown below
What all tabs are shown in above dialog would depend on Add-ins that is loaded. Using above dialog we can set on what all application should QTP record on.
Note: If QTP does not record anything on your application then make sure you have the correct settings specified in Record and Run Settings…
Keyword view
The Keyword View enables you to create and view the steps of your test in a keyword-driven, modular, table format. This is the only view where complete Test flow can be viewed.
Expert View
In Expert View, QTP displays each operation performed on the application in the form of a script, comprised of VBScript statements. Complete test flow is not available/visible in this view.
Test and Run-time Object
QTP works on objects in Application Under Test (AUT) by storing object description
This object description is known as a Test Object
Each Test Object supports predefined sets of Methods and properties
The actual object in the AUT which is identified for a Test Object is called the Run-time object.
A Test Object can always be present without the AUT
Run-time object can only be present when AUT is up and running
Object Spy
Object Spy is a tool that can be used to spy Test and run time object for looking at properties and methods supported by object being spied
Test Object Properties Run-time Object Properties
Object Identification
QTP uses three types of properties when identifying a object
Mandatory – Always learn these properties for the object
Assistive – Learn in case Mandatory properties are not enough to identify the object uniquely
Ordinal identifiers – Learn in case both mandatory and assistive properties are not able to recognize the objects correctly
Ordinal identifiers are of three types
Index – index of object (0, 1, 2 …)
Location – Location of the object on the screen (0, 1, 2 …)
CreationTime – Used only for Browser. Launchtime of browser (0, 1, 2 …)
Object Identification Settings
Launch from menu Tools->Object Identification…
Here we can Add/Remove properties from/to Mandatory and Assistive properties. Objects in application represent certain special characteristics which allow QTP to map them QTP Test object. For window objects this characteristic is mostly define by ”regexpwndclass“. In case application developers don’t use standard class names while creating object QTP won’t be able to identify the object correctly. Below is a checkbox in Search window recognized by QTP as WinObject
By clicking on the ”User Defined…“ button on Object identification settings window, we can add such objects and map. Once added QTP will now be able to recognize the object correctly
Object Hierarchy
QTP uses object hierarchy to identify object inside a AUT
Consider the object spy image shown below. The Web Edit ”q“ is a child of WebTable ”Advanced Search“
QTP only adds those objects from hierarchy which are necessary for it to identify the object later.
By default all property values are considered as regular expression patterns
When using string description all regular expression must be used with escape character for literal meaning. Ex - …Link(”text:=Logout \(Tarun\)“).Click
DP based Object repository can be created in any file
Code can be copied from one script to another without copying the object repository