QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP

This Site has been brought to you by HP Certified Expert of QTP.

Exciting new articles for October:

1) QTP Tip:Deselect all Radio Buttons

2) HP QTP Crypt Object

3)Adding Hyperlinks in Excel Spreadsheet

Best of Luck Friends ! ! !

Expert QTP

All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.

Copyright © 2009 ExpertQTP

Google Search

Friday, June 6, 2008

Know the Basic Features of Quick Test Professional

To see the basic tutorials on QTP, you can visit

Quick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool created by the HP subsidiary Mercury Interactive that allows the automation of user actions on a web or client based computer application. It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.

As part of a functional test suite, it works together with Mercury Interactive WinRunner and supports enterprise Quality Assurance.

The latest release of QTP is 9.5


QTP is a UI automation framework designed mainly for Windows and Web-based applications. It works by identifying the objects in the application UI or a web page and performing the desired operations on them (like mouse clicks or keyboard events); it can also be used to capture object properties like name or handler ID etc. One of the most important topics in QTP is Object Identification.

Though QTP is usually used for "UI Based" Test Case Automation, it can easily handle "Non-UI" based Test Cases. (e.g. API (Certification testing), Database Testing, etc.)

Some of the key features of QTP are:


Plug-ins are used to make recording more acceptable to a specific application, we use web plug-ins to automate test cases with respect to web applications. QTP has default plug-ins for ActiveX controls, web applications and VB objects. Plug-ins for other objects, such as Microsoft .NET objects, are also available. Multimedia plug-ins are also available. In general, each QTP plug-in is available at an additional cost. QTP can also identify the windows objects, even if we don't select any plug-ins at the launching of the application.

License Models

Two types of licenses are available from HP
1. Node Locked

Node-locked refers to assigning QTP to one machine.

2. Floating (Concurrent)

Floating allows a license to be shared between machines at any given point in time.
(1 Floating license allows QTP to be accessible from an entire lab's worth of PCs
but can only have 1 instance running at any given point in time).

Record and Playback

Initial development of automated tests with QTP is usually done by record-and-playback. A user's actions are captured via Microsoft's Component Object Model (COM). These are recorded into Actions, a kind of subroutine, as VBScript commands. All manipulated objects that QTP recognizes are also added to the object repository. Once recorded, the scripts are editable in either Keyword View or Expert View.

After clicking on the playback button all these actions will be played back. During playback, QTP attempts to identify and perform operations on the same objects, again using COM.


Checkpoints are a feature used for verifying the application under test. One can add a check point to check if a particular object, text or a bitmap is present in the automation run.

In short, checkpoints are used to verify that during the course of test execution, the actual application behavior or state is consistent with the expected application behavior or state.

Available checkpoints in QTP include standard check point, image checkpoint, table checkpoint, xml checkpoint, database checkpoint and page checkpoint. The VBScript Reporter.ReportEvent function also produces output very similar to that of a checkpoint, allowing the creation of custom checkpoints.


Recovery is the name for exception handling in QTP, with the goal of enabling the tests to continue to run if an unexpected failure occurs. For instance if an application crash occurs and a message dialog appears, QTP can be instructed to attempt to restart the application and continue with the rest of the test cases from there.

Output Value

This feature is used to store the run-time values/data that are displayed in the application into the run-time data table, so that we can use these run-time values in the script for further use.

Say if we need the value which is dynamically created or processed by application for later use, we can go for output concept.

Data Table

The data table is a table primarily used to implement [data-driven testing]. It is implemented as a Microsoft Excel workbook that can be accessed from within QTP. There are two types of Data Tables available in QTP: the Global data sheet and the local data sheets. The Global data sheet is a single sheet which is accessible from every Action in a test. By default, each row of this sheet specifies the values to be used in an iteration of the entire test.

There is also one local data sheet associated with each Action. As the Global data sheet specifies iterations of an entire test, these sheets are often used to set up iterations of a single Action. The data in these sheets can only be accessed from their associated Action. While it is possible to access a different Action's local data sheet, it cannot be done from the Object Repository or from inside a checkpoint.

Virtual Objects

Complex objects may not be recognized properly by QTP. The Virtual Object concept was implemented to enable users to add some degree of support for these objects. If an object is not recorded out-of-the-box, an experienced user may be able to define that object as a personal virtual object and build a virtual object repository. Assuming that the required information can be extracted from the object, this allows the users to successfully record and playback against that object. In practice, this is not always possible.


This feature can be used to calculate the time required to run a particular test or particular steps in the tests. Transactions are most often used in automated software performance testing, so they are infrequently used in QTP.


QTP generates the result file for the test cases at the end of test in the form of XML tree. The result file provides detail regarding PASS and FAILS counts, error messages, and potentially supporting information that allows users to determine the underlying cause of a failure.

User Interface

QuickTest provides two main views of a script: Keyword View and Expert View. They are selected from tabs at the bottom of the QuickTest Professional window.

Keyword View

Keyword View is QTP's default test procedure interface. It displays the automation steps of a test procedure as a descriptive tree of Actions and functions. The tree contains columns listing the Action or function name, any parameters, and comments. This mode is most useful for the beginners in operating with the tool. This view allows the user to select the objects either from the application or from the Object Repository and the user can select the methods to be performed on those objects. The script is automatically generated. Users can also set check points from keyword view.

Expert View

In Expert View, QTP allows display and editing of the a test's source code. All test actions can be edited here except for the root Global action. Expert View acts as an IDE for the test. It includes most standard IDE features, such as breakpoints.

This view is most suitable for the advanced users, enabling them to customize the test, such as by writing user-defined functions.

Copyright © 2009 ExpertQTP