Jul 12

QTP Output Values vs Checkpoints

Recently I saw some comments in some forum groups where people seemed confused between QuickTest Pro Output Values and Checkpoints, along with whether they should use the built-in features to create these statements versus coding the comparisons themselves.  Here are some points to consider:
– Don’t confuse “Output Values” with “Checkpoints”, they are not the same.  Completely different functionality.
– Both “Output Values” and “Checkpoints” are considered a feature of “Record and Playback”, reason being is because QTP has to interface with the object you are accessing in order to access the object’s properties and therefore you have to be in recording mode to know about the object.  The only exception to this is  that you can create the statements off the Active Screen if you have previously recorded against the object, otherwise the functionality is disabled off the menubar if you are not in recording mode.
– The big benefit of using “Output Values” or “Checkpoints” is that you can check a lot of things in a single statement.  For example I can check 6 different properties of an object in a single checkpoint statement and get pass/fail results for each check.  If you did the same thing you would have to code significantly more – a minimum of 6 statements (one for each property you are retrieving) and then a conditional statement in order to compare the results and pass or fail it with a “Reporter.ReportEvent” method.  You either need a conditional statement for each check or you would have to write a subroutine.  This is a lot more work than just using the Checkpoint window, quickly clicking on the checkboxes of the properties you want to verify and clicking OK to generate a single statement.  When it comes to the web and say you want to perform a Page Checkpoint, what you can do in the standard QTP Page Checkpoint window is significant compared to having to code it.  Can you code pinging every link on a page and pass or fail it in literally a one click action, and end up with one statement?  No you can’t, but with a Page Checkpoint you only have to check the “Broken Links” checkbox and now the statement will validate every link on your page and make sure it brings you to a valid page and not a 404 error, all in a single statement.
> Likewise the same concept for Output Values holds true.  In one statement I can retrieve 6 properties into the DataTable and have their values stored there for use later in my test script.  One statement, quick and easy.  Coding would require 6 statements.
– Remember:
> “Output Values” are used to retrieve values for later use and so it will retrieve the property values you select and place them in the datatable for you.
> Checkpoints are primarily used to see if the property values of an object have changed from an anticipated value, or state in the application.  Like: has my button moved, is the edit field enabled or disabled, what is the current default value in the edit field, etc.  In addition, checkpoints have the ability to use parameters in order to handle dynamic situations so you don’t have to hardcode a value in the checkpoint.

The bottom line is the more you have to check, the quicker and easier it is to do it with the built-in features.  Believe me I do tons of coding myself, but use your time wisely.  If I can crank out some validation using the built-in features really fast then I do it, and make sure you are using the appropriate statement for the task at hand – comparison versus saving off a property value.

Remember to check out the new training courses on our Products page.

  1. QuickTest Pro Basics
  2. QuickTest Pro Advance Training
  3. VBScript for QuickTest Pro


by sloporto | About the author:

Related Posts

  • No related posts found.

You must be logged in to post a comment.

Name (required)

Email (required)


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Share your wisdom