A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property .

We can view the results of the checkpoint in the Test Results window.

Types of CheckPoints

             We can add various types of checkpoints

Ø      Standard check point

Ø      Text check point

Ø      Text area check point

Ø      Bit map check point

Ø      Data base check point

Ø      Accessibility check point

Ø      XML Check point (from Application)

Ø      XML Check point (from Resource)

Ø      Page check point

Ø      Image checkpoint

Ø      Table checkpoint

Standard Checkpoint checks the property value of an object in your application or Web page.

The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, and so forth.

For example, you can check that a radio button is activated after it is selected or you can check the value of an edit box.

Image Checkpoint checks the value of an image in your application or Web page.

For example, you can check that a selected image’s source file is correct.

Bitmap Checkpoint checks an area of your Web page or application as a bitmap

Useful for testing zoom of map and for testing logo.

Table Checkpoint checks information within a table.

Text Checkpoint checks that a text string is displayed in the appropriate place on a Web page or application

Accessibility Checkpoint identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines  (e.g Alt for Img tag)

Page Checkpoint checks the characteristics of a Web page.  (e.g web page loading time, checking broken links)

Database Checkpoint checks the contents of a database accessed by your application.

XML Checkpoint checks the data content of XML documents in XML files or XML documents in Web pages and frames

How to Learn QTP?

This chapter will give overview about learning QTP. You can read the details in coming chapters.

  • Begin with understanding the importance of software testing. You should learn software testing Concepts and you have to get clear understanding of functional and regression testing. You need to be bit familiar with Manual testing activities such as writing test cases, executing test cases and reporting the issues.
  • You have to understand the need and importance of software test automation before start learning QTP. Even having some basic knowledge about other Test automation tools such as Test Complete, Test Partner, SilkTest and Rational Robot will help to prepare Tool evaluation/selection document if you are going to use QTP as Test Automation Tool in your project.
  • Download some good QTP handbook from internet. And also, you can refer the Tutorial and other Help files installed with QTP installation.
  • Try to understand basics of Object repository. You will become more familiar with using Object Repository once after start working on QTP automation.
  • Familiarize yourself using QTP add-ins (i-e selecting/deselecting specific add-ins). Desired Add-ins can be selected while launching the QTP. Note that the add-ins enabled during recording should be enabled while running the script.
  • Understand the basic units such as Test, Actions and external vbscript in QTP by going thro’ the Help file and the Handbook document. Practice yourself by creating simple Test with one or two Actions.
  • Practice yourself by recording and playing some steps using the sample application (Flight booking Application).
  • Try to understand the need for having multiple Actions in a particular Test.
  • Practice yourself creating Actions and splitting the Actions. And also, understand the need for having external reusable actions, and practice yourself using “Call to Copy of Action” and “Call to Existing Action”.
  • Familiarize yourself with components such as Expert view, keyword view, Active Screen and Datatable.
  • Learn basics of vbscript by going thro’ the vbscript documentation available in QTP help file, and be familiar with syntax of frequently used vbscript functions such as mid, instr and split.
  • Do some practice to have clear understanding of relation between Test Objects stored in object repository and the Vbscript statements showing in the expert view. You can do it by changing name of Test Object in OR and see the name automatically got changed in the expert view statement. And also, you can try to add/remove/edit some properties of Test Object in the Object Repository.
  • Understand the relationship between the Keyword view and the expert view. Both views are having their own advantages. So try to use both views. For example, Keyword view will be useful for doing parameterization easily and expert view can be useful or rearranging the steps.
  • Learn different types of Checkpoints and use them in sample script developed using the sample application. Intentionally put wrong expected result in the checkpoints to see how the Test result will look when showing checkpoint failures.
  • Learn to use multiple Object repositories (both Local and Shared), and also practice to get clear understanding of merging of Object Repositories.
  • Learn Recovery Scenario to handle unexpected behavior of application.  For learning Recovery Scenario you may need some application which shows a pop-up window rarely/randomly. Mostly you can use a website which is having both https and http links. Security alert will be shown while moving from https pages to http pages.  You can use Recovery Scenario to handle this security alert window.
  • Read the Help file to get clear understanding of Datatable and parameterization. And also learn about Action iteration and Test iteration without any ambiguity. Practice it by creating Data Driven testing for simple login screen.
  • Start using Reporter.ReportEvent in the code to enhance the reporting of the results.
  • Use ObjectSpy to get familiar with finding both TO  properties and RO properties of the Object in the Application.
  • Learn to change Test Settings and the editor settings. Here you should have clear understanding of which setting is applicable for the particular Test and which setting is applicable for particular instance of QTP installation.
  • Understand the need for Synchronization and try to use different ways (use of sync(), waitproperty, and exist) to achieve it.
  • Practice to use Step Generator, Function Generator and Active Screen to speed up the automation script creation process. Effective use of Active Screen will help you to continue your QTP script development even when your application is not available.
  • Learn about different types of recording modes and understand the need for them. Low level recording may help you to handle some steps if the standard recording is not able to recognize the object using the currently available add-ins.
  • Learn how to create/use COM objects such instance of Internet Explorer browser and an instance of excel object. It will be very useful
  • Learn to use Debug feature effectively. For example, use of “Run from step” will significantly reduce the Debug time.
  • Understand the need for Regular expression and learn some frequently used regular expressions (e.g .*)
  • Learn about QTP automation framework creation, and try to create a framework best suitable for your needs.
  • Learn Automation Object Model and understand the need for them. For example Automation Object Model can be used for automatically start running QTP script at specified time.
  • Learn about best practices (e.g always using reference path) and coding standards.
  • Go thro’ the QTP forums (e.g and read the discussions to get familiar with QTP issues and solutions/workarounds.
  • Learn to connect with database table for checking the database content. For doing this either you can use Database Checkpoints or you can create script using createobject.
  • Learn basics of Descriptive programming (DP) which is the alternative for Object Repository (OR). Personally I won’t recommend to use DP because it will create maintenance problem. But anyway we need to learn Descriptive programming in case we need to update any existing DP code.
  • Learn to integrate with Quality Center (QC) which is Test Management Tool provided by HP. It was formerly known as “Test Director”. We can execute the scripts from QC itself. And, it is used  for maintaining Test cases and tracking Bug/Issues. Appropriate integration of QTP and QC will make Script maintenance, Execution and Reporting easy.

Introduction to QTP

Since QTP supports external add-ins, it can be used for automating testing of many different software applications and websites.
Some add-ins (e.g ActiveX, VisualBasic, Web) are built-in with QTP, and some other add-ins (e.g Java, .net, TE (terminal emulator))are external add-ins. External add-in means we need to install them separately once after installing QTP.

We have the option to load only the required add-ins when opening the QTP IDE. So, it will be helpful to improve the execution speed.

QTP will support Keyword Driven and Data Driven testing. We can create our own test automation framework (Hybrid framework) also based on our own requirements for test automation.

It is very important to understand how QTP works. Because it will help to learn any other features in QTP easily. And, it will help to design an effective automation framework. It will help to resolve any issue that may come across during automation script development and also during script execution.

It can be explained as below,

We know that every test case should have Test Steps and Expected Results.

As QTP is used for executing these test cases, QTP also should have a way for handling both Test Steps and Expected Results.

Handling Test Steps means, QTP should be capable of navigating any path/page in any website or in any software application.
For achieving this QTP should be able to recognize any control/object in any application/webpage which needs to be tested. For recognizing the object, it should know the properties of those objects beforehand. It is achieved by storing the properties of the objects in a centralized place known as Object Repository.

While running the test script, the objects in the application are identified/recognized by comparing the properties of the objects with the properties stored in the Object Repository. By doing this recognition, execution of Test Steps becomes possible.

QTP is having Datatables (similar to Excel sheet) for supporting execution for multiple iterations of same steps with different data. For example, assume that we need to execute two test cases, one for logging into a website using UPPER case username and another test case for logging into a website using lower case username.

For executing these two test cases, the steps will be same. The only difference is in the test data.

It can be easily done in QTP by putting these input usernames in Datatable and make the Script to execute it two times.

Next, we need to think about handling Expected Results. The purpose of testing is comparing the Actual result with the predefined Expected Results. It is achieved by using Checkpoints.

There are many checkpoints available in QTP. They are Standard Checkpoint, Text Checkpoint, Bitmap Checkpoint, Database Checkpoint, accessibility Checkpoint and XML Checkpoint.

Actually QTP can be used simply as Record and Play type tool for automation of simple steps on simple applications. But it should be extensively used by writing user defined functions and many other features to get more benefit from it.

QTP is not using any Proprietary Script. It uses commonly available VBscript. So, writing script will be simple. And also, vbscript is commonly used in many places such as Web development (ASP), and in windows administration works. So we can easily find lot of already available user-defined functions and help articles in the Internet.

And, QTP supports COM model. i-e Any methods and properties of any COM based application can be easily accessed from QTP. For example IE(Internet Explorer) and Excel Objects can be created within QTP script. i-e IE can be opened from QTP itself using vbscript and the script can navigate to the desired url and mostly it can do whatever we do manually in IE.
This COM support is applicable for QTP itself.
i-e Object of QTP itself can be created and handled. It is known as Automation Object Model. It will be useful for exporting the environment settings and also useful for scheduling the QTP scripts execution.

Basically, QTP is a functional/Regression testing tool. But it can be indirectly used for testing performance also. (i-e QTP scripts can be called from performance testing tool “Load Runner”). And, QTP is having limited performance testing options such as start and end transactions which will be helpful to find execution time for particular block of steps.

QTP can be closely integrated with the Test Management Tool Quality Center (QC). QC can be effectively used to run QTP scripts in multiple remote machines to complete execution of many test scripts in less time.

The user friendly IDE which has Keyword view, Expert view, Datatable, Active screen, object repository editor/manager, step generator, function generator, object highlight feature, intellisense, recovery scenario manager, update run feature and simple Test/Action handling features makes the Script developer/execution work easy. The IDE is integrated with useful tools such as ObjectSpy. The IDE has standard development features such as Debug