A checkpoint verifies that expected
information is displayed in the application while the test is running. Checkpoint helps to identify
whether the application is functioning correctly. Checkpoint is a verification step that compares the current value
for specified properties or current state of an object with
the expected value or characteristics. If the results do not match, the
checkpoint fails. Results of the checkpoint are displayed in the Run Results
Viewer.
Types of checkpoints
Following are the different types of checkpoints that can be created in QTP.
Standard Checkpoint: Following checkpoints are created in QTP as Standard Checkpoint.
Bitmap Checkpoint - verifies the actual bitmap of the area with expected bitmap
XML Checkpoint - compares expected xml with actual xml
Database Checkpoint - compares expected value in database with actual value
Accessibility Checkpoint - compare accessibility of the page.
Standard Checkpoint: Following checkpoints are created in QTP as Standard Checkpoint.
- Page Checkpoint - checkpoint inserted on page object
- Image Checkpoint - checkpoint inserted on image object in the page
- Table Checkpoint - checkpoint inserted on table object in the page
- Standard Checkpoint - checkpoint on object other than page, image and table object.
Bitmap Checkpoint - verifies the actual bitmap of the area with expected bitmap
XML Checkpoint - compares expected xml with actual xml
Database Checkpoint - compares expected value in database with actual value
Accessibility Checkpoint - compare accessibility of the page.
Inserting a Checkpoint
Standard checkpoints are used to perform checks on
images, tables, Web page properties, and other objects within application.
A checkpoint can be inserted in the test in following ways:
• Using Active Screen: If using the Active Screen option, ensure that the Active Screen contains sufficient data for the object that needs to be checked.
• During Editing Sessions: To insert or modify an existing checkpoint step while editing, open the application and display the relevant object before proceeding to the next step.
Following are the
steps to insert a standard Checkpoint.
•Select Insert
> Checkpoint menu for inserting a checkpoint during
recording mode or right click on object in active screen.
•Select option
Insert Standard Checkpoint which opens the Checkpoint Properties dialog box. Select the node in the tree where checkpoint
needs to be inserted and click OK.
Checkpoint Properties:
Once an object is
selected for checkpoint, different checkpoint dialog box opens based on the object type selected as shown below:
Following are the
area displayed for checkpoints properties:
- Object Details area: name that QTP assigns to the checkpoint object and the class of Object.
- Properties grid area: For each object class, QTP recommends default property checks. To check a property, select the corresponding check box in the properties grid area.
- Configure Value area: This area enables to configure object property values or the values of the operation arguments defined for the step.
- Checkpoint Timeout and Statement Location area: Checkpoint Timeout Specifies the time interval (in seconds) during which QTP attempts to perform the checkpoint successfully.Insert statement specifies whether to insert the checkpoint step before or after the currently selected step
Checkpoint in Expert View
Checkpoint is
displayed in Expert View as:
Browser("Mercury Tours").Page("Flight Confirmation").Check Checkpoint("New York") Return value from checkpoint can be stored in a variable. Eg: Dim return return = Browser("Mercury Tours").Page("Flight Confirmation").Check Checkpoint("New York")
This will give
value as true or false based on checkpoint passed or Failed.
checkpoints can be defined from the expert view. nice article
ReplyDelete