Checkpoints In QTP


Checkpoints are verification points in the test which allow us to compare expected to observed values. Checkpoints can be added while recording the test or afterwards when editing the test. In general, it’s easier to add a checkpoint after the test has been recorded.

Checkpoint information is stored in the Local Object Repository. In the expert view, on any blank line type Checkpoint and put "(". As soon as we put the starting bracket it will show all the checkpoints we have used in the test.

We can add a checkpoint in the keyword view by selecting a row, right clicking and selecting Insert Standard Checkpoint. This will open a dialog that looks like this:

cid:image003.png@01CAA0CB.755C02D0

We can then choose which property of the control we wish to verify, whether or not we want to use a constant or a parameter, the number of seconds QTP has to verify the checkpoint  and whether we want the verification to take place before or after the currently highlighted step.

Checkpoint property’s values can be either validated with the constants or they can be parameterized. In case of parameterization, values (which are expected to be property value) are passed through Data sheet and property is validated against those values during run time.

To add checkpoints while recording or editing:

Ø  Use the commands in the Insert > Checkpoint menu, or click the Insert Checkpoint button on the toolbar. This displays a menu of checkpoint options that are relevant to the selected step.



Ø  Right-click the step where we need to add the checkpoint and choose Insert Standard Checkpoint.
Ø  Select the step where we need to add the checkpoint and choose Insert > Checkpoint > Standard Checkpoint.
Ø  Right-click any object in the Active Screen and choose the relevant checkpoint option:
·         Insert Standard Checkpoint
·         Insert Bitmap Checkpoint
·         Insert Accessibility Checkpoint


These options can be used to create checkpoints for any object in the Active Screen (even if the object is not part of any step in the Keyword View).

Different Types of Checkpoints :

*      Standard Checkpoint checks the property value of an object in the 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, we can check that a radio button is activated after it is selected or can check the value of an edit box.

*      Image Checkpoint checks the value of an image in the application or Web page. For example, we can check that a selected image’s source file is correct. We can create an image checkpoint by inserting a standard checkpoint on an image object.

*      Bitmap Checkpoint checks an area of the Web page or application as a bitmap. For example, suppose we have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. We can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, we can check that the map zooms in correctly.

*      Table Checkpoint checks information within a table. For example, in our application we have WMPs displayed as a Table in the Plan Setup page, so here we can add Table Checkpoint and can pick the WMP Owner name for the first WMP in the table. This can be inserted by Standard checkpoint on the table object.

*      Text Checkpoint checks that a text string is displayed in the appropriate place on a Web page or application. For example, in our application we can create a text checkpoint that checks that the word “Project Space” is displayed between “Process Space” and “Work Space”.

*      Text Area Checkpoint checks that a text string is displayed within a defined area in a Windows application, according to specified criteria. For example,
suppose Visual Basic application has a button that says View Doc , where is replaced by the four digit code entered in a form
elsewhere in the application. We can create a text area checkpoint to confirm that the number displayed on the button is the same as the number
entered in the form. Text area checkpoints are also supported for some external add-in environments, such as Java.

*      Accessibility Checkpoint identifies areas of the Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines. We should provide a text equivalent for every non-text element. We can add an Alt property check to check whether objects that require the Alt property under this guideline, do in fact have this tag.

*      Page Checkpoint checks the characteristics of a Web page. For example, we can check how long a Web page takes to load or whether a Web page contains broken links. We can create Page checkpoint by inserting a standard checkpoint on a page object.

*      Database Checkpoint checks the contents of a database accessed by your application. For example, we can use a database checkpoint to check the
details of a database containing Project information for our application.

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

Checkpoints are also differentiated as Normal QTP Checkpoints (as listed above), and Custom Checkpoints. Following are the Custom checkpoints which are normally inserted within some conditions and can be viewed in the Test Results window.

Ø  Reporter.ReportEvent micDone
Ø  Reporter.ReportEvent micPass
Ø  Reporter.ReportEvent micFail
Ø  Reporter.ReportEvent micWarning

cid:image001.png@01CAA34C.5A4B80A0

cid:image002.png@01CAA34C.5A4B80A0

0 comments:

Post a Comment