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

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated February 24, 2024

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 the current and expected values of an object match or not. This determines the PASS or FAIL status of the test.

=> Click Here For QTP Training Tutorials Series

In today’s tutorial, we will deal with QTP Standard and Image checkpoints in detail.

Insert Standard and Image Checkpoint

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) The active screen can also be used to insert this checkpoint. Sufficient information must be available on the active screen in order 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 an enter Login, enter a password, and click OK; and the setting on my active screen is just to store the objects that 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 on 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 can be used on our 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: The 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 will appear.

Standard checkpoint 1

Step #7: Choose the object and click OK in the dialog. The checkpoint properties dialog box will be displayed.

Standard checkpoint 2

Step #8: Select the properties you want to be checked and click OK. I am just going to choose the name. As you can see above, you can modify the properties 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.

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-click on an object and select the option to insert a standard checkpoint. After that, follow the same steps as above to insert a checkpoint.

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 above.

How can Checkpoint properties be accessed and modified?

After creation, the user can modify the 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 the 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 available there are shown below:

Standard checkpoint 6

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

Since the standard checkpoint is the first on 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 to 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 is 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 the “Checkpoint Properties” dialog, and it is specific to images.

The only extra parameter is the “Compare Image Content” checkbox. If it is checked, the image in runtime 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, then the test results will only have one image. If they are different, then 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.

Image Checkpoint 1

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

This is what the inserted checkpoint is going to be.

Image Checkpoint 2

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 sessions. Feel free to post your questions.

=> Visit Here For The QTP Training Tutorials Series

Was this helpful?

Thanks for your feedback!

Recommended Reading

14 thoughts on “QTP Tutorial #13 – Steps to Insert Standard and Image Checkpoint in QTP Tests”

  1. 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.

    Reply
  2. 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 ?

    Reply
  3. Please help me, I have an query related to XML checkpoint. Could please post a tutorial on this? It would be helpful.

    Reply
  4. 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?

    Reply
  5. @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.

    Reply
  6. @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.

    Reply
  7. @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.

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

    Reply
  9. 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

    Reply

Leave a Comment