Here is a compile of some learning I had on working with QTP on one of the projects, believe me, I have used a lot of tools within very small amount of time. I always had a challenge to master the tool to make the project - "test automation" project a success (at least for me). So every time, I learnt a new tool, I used to prepare such key notes that one should know to start working on the tool. Here is one for QTP, this was built on QTP 6.5 version which might be outdated now, but the core simple concepts that you need to know are still the same, so take a look,
This article covers,
- QTP Architecture
- ActiveX and Web addins
- Basic Scripting
- Running your script
- Debugging your script
- Data Table
- Check Points
- Test Director Integration
- Win Runner Integration
- Enterprise-wide Environment Support
- Features & Benefits
- Limitations
- Functional and regression test automation tool
- Good for web client/server base application automation
- Fairly intuitive, easy to use
- Object and action based scripting tool.
- Action Based - Quick Test is by nature, an ‘action’ based automation creation tool. An action within QT can be thought of like a function within any other programming language. It is how QT breaks up steps or actions within a script, such as: Login, or Navigate to Configuration Administrator. This allows each user to easily organize their scripts. There are two different ways to view the actions: Tree View, and Expert View. Tree View allows the user to see their action organized into something closely resembling a file structure. Each page and action taken upon that page drills down to a subsequent page and another resulting item. The Expert View allows the user to see the actual code used to execute their action. This is a much easier way to edit the script and code, as well as write custom code for a script; however the organization is not as easily apparent.
- Object Oriented - The entire foundation of Quick Test is based off of objects. Everything within a browser is considered an object, from; tables, to frames, to links, to radio buttons. Quick Test looks at the properties for each object, and captures enough properties to uniquely identify that particular object. It will look at: HTML name, object text, height, width, index, etc.

- A function library is a collection of functions and global variable assignments that can be integrated with a QuickTest test.
- The function library must be in a Visual Basic Scripting formatted file. (.vbs)

- In a new or existing test, navigate to Test -> Test Settings -> Resources tab
- Click the green + button, and enter the full path, including the filename to the function library.
- In order to have each new test automatically use this function library in the future, click the Set as Default button
- Click OK
- Each new test created will now use that function library defined in the settings dialog.
- Visual Basic Language Structure
- Quick Test uses a supplemented version of the Visual Basic language as its scripting language
E.g. the Web Add-in is necessary so that Quick Test may insert its hooks into the various browsers that are supported by the web application. It must be selected as an add-in when Quick Test first starts up. In order for Quick Test to recognize the objects in a particular browser, the browser must be launched after the instance of Quick Test has been opened. QT cannot insert its object hooks into a pre-existing browser session
- Recording the script
- Reading the script
- Running the script
- Debugging the script

- Navigate to the QuickTest window, and click on the “Record” Button:
- If this is the first time recording within a new test, the user will be prompted with the Record and Run Options dialog. Choose the option to Record and Run the test on any open web browser. (To access these settings after the initial recording, go to: Test -> Record and Run Settings)
- Click OK, then click on the browser window, and log into the product.
- Navigate back to the QuickTest window and click the Stop button. This will be your first action.
- Give the action name start recording steps. You may also select to convert this action to a reusable action, so that you may just call this particular action each time you wish to add a login action to a script
- The Expert View is available for advanced users who would like to create custom VB code to insert into their script

Note the different icons for each action. The yellow bubble icon denotes a comment. The double quotation icon denotes a specific VB call (In these cases variable declaration and a loop break). The red to green arrow indicates an object or variable association, etc.
- Running the script Ensure that no other browser windows are open
- Ensure that a call to open a browser at a specific URL is the first item executed in the test
- Step Into: This allows a literal line by line execution of the code.
- Step Over: Step Over will skip over the currently queued line of code, and will execute the subsequent line.
- Step Out: Step Out will run to the end of the called action or user-defined function, then returns to the calling action and pauses the test run.

- To edit the Data Table:
- Open your test. Make sure the Data Table button is enabled.
- Each row in the table represents the set of values that QuickTest submits for the parameterized arguments during a single iteration of the test or action. QuickTest runs the iterations of your action based on the settings selected in the Run tab of the Action Properties dialog box. The number of iterations that a test runs is equal to the number of rows in the Global sheet.
- Each column in the table represents the list of values for a single parameterized argument. The column header is the parameter name.
- Global Data table
- Local/Action Data table

|
Checkpoint Type |
Description |
Example of Use |
|
Standard Checkpoint |
Checks values of an object’s properties |
Check that a radio button is selected. |
|
Image Checkpoint |
Checks the property values of |
Check that the image source file is correct. |
|
Table Checkpoint |
Checks information in a table |
Check that the value in a table cell is correct. |
|
Page checkpoint |
Checks the characteristics of a Web page |
Check how long a Web page takes to load or if a Web page contains broken links. |
|
Text / |
Checks that a text string is displayed in the appropriate place in a Web page or application window |
Check whether the expected text string is displayed in the expected location on a Web page or dialog box. |
|
Bitmap Checkpoint |
Checks an area of a Web page |
Check that a Web page (or any portion of it) is displayed as expected. |
|
Database Checkpoint |
Checks the contents of databases accessed by an application or Web site |
Check that the value in a database query is correct. |
|
Accessibility Checkpoint |
Identifies areas of a Web site |
Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines. |
|
XML Checkpoint |
Checks the data content of |
Note: XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page. |


Core Environments
- Windows applications (MFC)
- Visual Basic
- Java
- ActiveX
- SAP
- Siebel
- PeopleSoft
- Oracle
- HTML
- DHTML
- JavaScript
- Internet Explorer
- Netscape
- AOL
- .Net winforms, webforms, web services
- J2EE Web services
- XML, WSDL, UDDI
- Oracle
- Microsoft
- IBM
- BEA
- ODBC
- COM / COM+
- Flash
- RealAudio/RealVideo
- Windows Media Player
- Ensure an immediate return on investment through ease of use and pre-configured environment support: QuickTest Professional's integration of ActiveScreen, TreeView and the Data Table ensures that minimal time and effort are required for developing a powerful test suite and obtaining immediate results. As a result, even novice testers are productive as soon as they start using the tools.
- Easily maintain scripts with using the revolutionary Keyword View and TestGuard technology: QuickTest Professional supports full flexibility of the test script to handle changes in the objects, in the tested application’s GUI and in the testing environment. Test scripts are reusable throughout an application’s lifecycle. In addition, you can painlessly update multiple test scripts using the Shared Object Repository.
- Facilitate collaboration among testing groups enterprise-wide, with reusable test modules and function libraries: By using QuickTest Professional, testers can access a centralized repository and easily share actions, functions and test scripts across the network and enterprise.
- Enable testing of mixed environments and applications: QuickTest Professional provides a multifunctional solution for testing dynamically changing Web, Java, ERP/CRM and multimedia content across environments.
- Leverage investments in other automated testing tools: Mercury WinRunner (functional testing) and Mercury Quality Management (formerly TestDirector) our global test management product both integrate with QuickTest Professional. QuickTest Professional can launch WinRunner to execute TSL test scripts and view the results of those scripts. By doing so, companies can leverage their existing WinRunner TSL script and function libraries. Furthermore, QuickTest Professional can store its scripts and test results in Quality Management, enabling an entire QA and development team to effectively collaborate to improve application quality.
- Enable thorough validation of applications through a full complement of checkpoints.
- Data-drive every object, method, checkpoint, and output value via the integrated data table.
- Offer automation experts full control of underlying VBScript test code.
- Can create and implement the Microsoft Object Model (Outlook objects, ADO objects, FileSystem objects, supports DOM, WSH, etc.)
- Ease of use, Simple interface
- Currently there are fewer resources (consultants and expertise) available due to QTP being a newer product on the market
- Must know VBScript in order to program at all
- Must be able to program in VBScript in order to implement the real advance testing tasks and to handle very dynamic situations
- The Object Repository (OR) and “testing environment” (paths, folders, function libraries, OR) can be difficult to understand and implement initially
( 2 Votes )
| Comments |
|



























