How to use Text checkpoint in QTP?

Text checkpoint in QTP With Example.

Make sure that QTP and sample flight Application are open

Click on record toolbar button(or Automation menu->record or press F3) when record mode is selected, “Record and run settings” window opens up, Go to Windows Application” tab and choose first option “record and run on any open applications based application and click on ok button

To insert a order in the Flight reservation, do as follows

Enter the Date of Flight (with some future date as input)

Choose any Fly From city(in this case “Denver is selected”)

Choose any Fly to city(in this case “Frankfurt” is selected)

Clicks on Flight Button, which is on the Right hand side of Flight reservation application of the Fly To combo box

Flight Table window open up, select on option and click ok

Enter the name in name field

Click on Insert order and wait till the insert done…” message is shown in the progress bar

Text checkpoint in QTP -Flight Reservation Example

Select Insert->Checkpoints->Text Checkpoint, The Quick test window is minimized and mouse pointer in to a point hand

Click the text string for which the checkpoint wanted to be created, for example select “Frankfurt from dropdown” in the “Fly To “object of the flight reservation.

If the area defined is associated with more than one object, the object Selection Text Checkpoint Properties dialog opens, select the object for which the checkpoint want to be created.

Text checkpoint in QTP -Object Selection

Click ok to open the Text Checkpoint Properties dialog box

Text checkpoint in QTP -Properties

Specify the checkpoint settings if needed, click ok Button

The Following  code will be generated and added into the test by QTP, A tree item with a checkpoint icon is also called to test tree.

Window(“Flight Reservation”).WincomBox(“Fly To:”).Check Checkpoint(“Frankfurt ”)

Run the test and get the result.

Full Script Generated by QTP

“Window(“Flight Reservation”).Activate

Window(“Flight Reservation”).ActiveX(“MaskEdBox”).Type “102513”

Window(“Flight Reservation”).ActiveX(“MaskEdBox”).Type  micTab

Window(“Flight Reservation”).WinComboBox(“Fly From:”).Select “Denver”

Window(“Flight Reservation”).WinComboBox(“Fly To:”).Select “Frankfurt”

Window(“Flight Reservation”).Activate

Window(“Flight Reservation”).WinComboBox(“Fly To:”).Select “London”

Window(“Flight Reservation”).Dialog(“Flight Reservations”).WinButton(“OK”).Click

Window(“Flight Reservation”).Activate

Window(“Flight Reservation”).WinButton(“FLIGHT”).Click

Window(“Flight Reservation”).Dialog(“Flights Table”).WinList(“From”).Select “15833   DEN   10:24 AM   FRA   11:09 AM   AA     $103.40”

Window(“Flight Reservation”).Dialog(“Flights Table”).WinButton(“OK”).Click

Window(“Flight Reservation”).Activate

Window(“Flight Reservation”).WinEdit(“Name:”).Set “Test”

Window(“Flight Reservation”).WinButton(“Insert Order”).Click

Window(“Flight Reservation”).WinComboBox(“Fly To:”).Check CheckPoint(“Fly To:”)”

Text checkpoint in QTP -keyword view example


To Add a Text checkpoint in qtp while editing the test

Ensure only QTP and sample flight Application are running

Click record and insert the order in the Flight reservation as usual

Ensure the Active screen button is selected.

Click a step in the test where checkpoint wants to be added, the active screen displays the page or screen corresponding to the highlighted step.

Right click the text string and choose Insert->Text Checkpoint, Select an object dialog box

Select an object on which the operation will be performed

Click ok to open the text checkpoint properties dialog box

Specify the checkpoint settings if needed, click ok button

The following code will be generated and added next to the highlighted step, A tree item with checkpoint is also added to test tree

Window (“Flight Reservation”).WinComboxBox(“Fly To”).Check Checkpoint (“Frankfurt”)

Run the test and get the result


Leave a Reply

Your email address will not be published. Required fields are marked *