QTP Tutorials 11 – Checkpoint Return Value

We will use the Standard Checkpoint which we did in tutorial 4.

Open that test that contains the standard Checkpoint.
In the expert view of the test you will see only one line i.e.

Window(“Flight Reservation”).WinButton(“FLIGHT”).Check CheckPoint(“FLIGHT”)

Now we will make some changes in this one line so that it can return some value.

NOTE: Checkpoint always returns a value, it depends on us whether we capture it or not.

Lets now capture it.
Declare a variable and catch the return value in that variable:

Dim return
return = Window(“Flight Reservation”).WinButton(“FLIGHT”).Check CheckPoint(“FLIGHT”)
msgbox (return)

One thing more we need to do here is that we have to enclose Checkpoint (“FLIGHT”) in brackets. So the final version looks like this:

Dim return
return = Window(“Flight Reservation”).WinButton(“FLIGHT”).Check (CheckPoint(“FLIGHT”))

msgbox (return)

Now run the test and see the msgbox appearing with the return value.

0
 in QTP

Comments