QTP Tutorial #13 – Steps to Insert Standard and Image Checkpoint in QTP Tests

In the previous QTP training session we listed all the checkpoints that QTP provides. All these checkpoints are very important to insert verification points in QTP tests to check if current and expected values of an object match or not. This determines the PASS or FAIL status of that test.

In today’s tutorial we will deal with QTP standard and image checkpoints in detail.

Standard Checkpoint:

1) It is used to check the Object Property value.

2) Compares the expected value with the actual value during runtime.

3) It can be set during recording or editing a test.

4) Active screen can also be used to insert this checkpoint. It is important that sufficient information be available in the active screen to be able to insert a checkpoint.

For Example: If there is a screen with, Login edit box, Password Edit box, OK, Cancel and Help buttons. We need to check if the Cancel button is visible. We are trying to achieve this by placing a checkpoint on the “Visible” object property of the Cancel button. While recording I performed a enter Login, enter password and click OK; and the setting on my active screen is to just store the objects I acted on and not the others, I will not be able to place the checkpoint on the cancel button because the active screen does not possess information about that object. Therefore, it is important for the active screen to have captured all the objects in the page and only then we can insert the checkpoint. I hope this explains what I mean when I say that the active screen should have sufficient information.

5) Once added, the checkpoint properties can be changed using the “Checkpoint Properties” dialog box.

6) Every checkpoint gets added to the local object repository when added. It can be moved to the shared object repository if needed.

7) Supported for all the environments as long as the appropriate add-ins are loaded.

8) Some examples of the objects that this can be used on are: web images, Edit boxes, static text, web tables etc.

How to insert a standard checkpoint while recording:

Step #1) Insert->Checkpoint: Select this option from the menu after starting a record session.

Step #2) Standard checkpoint icon – Clicking on this icon also results in the same thing.

Step #3) A list of relevant checkpoints applicable to the current or selected step on performing one of the steps listed in 1 and 2.

Standard checkpoint

Step #4) Select the type of checkpoint. We will select “Standard” in our case.

Step #5) QTP interface gets hidden and the user can choose the object in the AUT over which the user wants to insert a checkpoint.

Step #6) Select the object and the following screen appears:

Standard checkpoint 1

Step #7) Choose the object and click OK in the dialog. The checkpoint properties dialog box is displayed.

Standard checkpoint 2

Step #8) Select the properties you want checked and click OK. I am going to choose just the name. As you can see above, you can modify the properties to to either a constant value or parameterize. There is also a timeout parameter that you can set. What this means is that, QTP waits for the particular number of seconds specified in this dialog for a certain Object to attain a property value before it performs the check.

Step #9) This is how I set the parameters and click OK.

Standard checkpoint 3

Step #10) This is how my checkpoint looks in the keyword view: (click to enlarge image)

Standard checkpoint 4

------------

Step #11) In the expert view, the following code gets displayed:

Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Check CheckPoint("Sign in_2") 

How to insert a Standard checkpoint while editing:

1) Active Screen:  In the active screen, right on an object and select the option to insert standard checkpoint. After that, follow the same steps as above to insert a checkpoint. (click to enlarge image)

Standard checkpoint 5

2) At any step in the QTP test, select the menu option “Insert->Checkpoint” and choose “Standard checkpoint”. Again follow the steps as above.

How the checkpoint properties can be accessed and modified

After creation, the user can modify a checkpoint as required. This can be done through the “Checkpoint properties” dialog box. This dialog can be accessed in the following ways:

1) While creating a checkpoint this box opens up for initial definition of the properties

2) Select an existing checkpoint statement in the Keyword view, right click and select “Checkpoint properties”

3) Open the Object repository and the properties are available there are shown below: (click to enlarge image)

Standard checkpoint 6

From this box, all the properties of a checkpoint can be modified as required.

Since the standard checkpoint is the first in our list I have provided the detailed steps of adding it in different scenarios and modifying it in different ways in detail. Moving forward I am going to list the properties and features that are unique for each checkpoint. It should be noted that the steps to add, use and manipulate the checkpoints are all the same for most of the checkpoints. From now on, unless specifically mentioned, the above approach can be used generically across the other ones too.

Image Checkpoint:

A slight variation of a standard checkpoint is while it is used on web images.

In case the object on which the checkpoint inserted happens to be a web image, the following dialog box opens up.

Image Checkpoint

It should be noted that this screen is almost identical to “Checkpoint Properties” dialog, it is specific to images.

The only extra parameter is the “Compare Image Content” checkbox. If it is checked, the image in run time is checked with the one stored during the creation of the checkpoint to see if it is exactly the same. If they are the same, the test results will only have one image. If they are different both the images will be displayed in the test results.

For example, on the gmail page, I tried to insert a standard checkpoint on one of the images from the Active screen and this is what gets displayed: (click to enlarge image)

Image Checkpoint 1

I will not make any changes in the dialog, you can if you wish to and click OK.

This is how the inserted checkpoint is going to be: (click to enlarge image)

Image Checkpoint 2

The expert view code:

 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").Image("nosign-r42").Check CheckPoint("nosign-r42") 

That is all for today! We will continue with the other checkpoints in further session. Please feel free to post your questions.

Note – If you have missed any tutorial in this series please check this first QTP session where we have listed all QTP tutorials.

Recommended reading

13 comments ↓

#1 Anjali Mone

Thank you for detailed tutorial.
Can you tell me where and how these checkpoints and actions stored in backend?

#2 Swati

@Anjali: These checkpoints are a part of your object repository for you to work on. Other than that, they are actually programmatic statements and are very much a part of your script. I hope I answered your question.

#3 Sundeep

Could you provide more info on constant and parameter checkpoint properties

#4 Senthil

Hi Swathi I have 2 questions 1. Does these checkpoints can be accesible only in presence of object repository and not programmable by descriptive programming? 2.In the image checkpoint if we select the “check image content” on what basis it will verify the image at run time .. is it by the x,y corrdinates ?

#5 Swati

@Sundeep: Are you asking about the constant and parameter values in the Step 9 of this article? It means that a certain property’s expected value can be specified as a constant value or parameterized as data table cell. I hope I understood your question right.

#6 Swati

@Senthil: 1. Checkpoints can be programmed. You can write your own code to validate or verify something in your application. What this article talks about are the built in checkpoints only.
2. Image checkpoint takes into consideration all or some of the properties in the screen shot you see above.

#7 Sundeep

@ swati : You understood my query and thx for ur reply

#8 V. Madireddy

Thank you. I Learned more from this tutorial.

#9 Sachin

Hi Swati, Can you please elaborate on the ‘Compare Image Content’ checkbox functionality. I mean, when we check this checkbox while adding Image Checkpoint, what exactly it will compare? Can you please explain this by providing a simple scenario that you used in your article?

#10 pournima

Can we add new properties through object identification and do standard checkpoint on them. For eg can we use checkpoint on object classes?

#11 SK Rao

Hi all.

I am facing a little problem in running tests in QTP 9.0.

I am unable to get active screen, although I can use the properties and methods like output value, checkpoints through descriptive programming as well as through keyword view.

In active screen tab, nothing is displayed while running a test. I tried making changes to active screen settings through tools > options > Active screen.
But it didn’t work.

You can reply me via STH FB comments at – https://www.facebook.com/SoftwareTestingHelp/posts/10152240587711119?stream_ref=5

#12 shekhar manche

I have created Standard check point according to your instructions, but when i am run the flight reservation after creating check points the results showing failed. what would be the reason it is giving failed results. i have entered correct username password for mercury. without check points if i run the same script it is giving me the passed results.

#13 sangeetha uvaraj

thanks for yours detail explain about standard chickpoint in qtp

Leave a Comment