What are Checkpoints in QTP?
Checkpoints in QTP are a verification point that compares a current value for a specified property with expected value for that property, it’s also used to identify whether the web site or application under test is functioning correctly or not by comparing a current value for a particular with the expected value for that property
When a checkpoint is added, Quick test adds a checkpoint with an icon in the test tree and adds a Check Checkpoint statement in the expert view, when the test is executed, quick test compares the expected results of the checkpoints to the checkpoint results, if the results do not match, then checkpoint fails, results of the checkpoint in the test results window can be viewed.
Types of checkpoints in QTP
Below are the types of checkpoints are available in Quick test professional(qtp)
Text area checkpoint
XML Checkpoint (File)
Standard Checkpoints in QTP
Standard checkpoints allows to check the object property values in the web site or application under test, it evaluate(compare) the expected values of object properties captured during recording to the object’s current values during a run session, for example, a radio button can be checked whether it’s activated or not after it’s selected.
How to do standard checkpoints:
Open QTP with a new blank test (Start->All programs->Quick Test Professional)
Open Flight Application (Start->All programs-> Quick Test Professional ->Sample Application->Flight), Login window of Flight Reservation opens up.
Type any agent name but must be 4 characters or more and enter password as “mercury” and click ok button.
Flight Reservation windows opens up
Click on record toolbar button(Automation Menu->record or press F3) when record mode is selected “record and Run settings” window opens up, Go to “Windows Applications” tab and choose first option “Record and run on any open windows based application” and click on ok button, after that Press F3 to record, during recording follow the below steps.
In QTP, Go to Insert(Menu)->Checkpoint->Standard Checkpoint(or Press F12),the mouse will become hand QTP will be minimized
Click on Flight’s (Flight reservation application) button
It will open objects selection->Checkpoint properties window (with win button FLIGHT Highlighted), click ok button.
It will open checkpoint properties window, select any property of the object, for example, select enabled property of FLIGHT objects.
Click ok button, stop recording by clicking Stop button
QTP Generates the script in the expert view, script will look like this
Window(“Flight Reservation”).Win Button(“FLIGHT”).Check Checkpoint(“FLIGHT”)
Save the test
This test can be run in two ways to see how it fails and passes the results of the checkpoint
To Get a Pass Test results:
Make sure that this and Flight Application is open
Click on run
It will run test and show the result as “pass”
To Get a Fail Test Result:
Make that this test and flight application is open
In the flight application, enter the date of flight, Fly from, Fly to fields and nothing else(the reason for doing is that it will enable the FLIGHT Button in Application)
Click on Run
It will run the test and show the result as “Fail”, This is because QTP was looking for a disabled “Flight ..button for which it recorded the information at the recorded time, but now since the button was enabled at run time, so it become failed.