Tuesday, 18 December 2012

Checking Objects | QTP Tutorial PDF

Checking Objects

In this section, you will add a standard checkpoint in the Book a Flight page.
This checkpoint will verify the value in the box containing the first name of the passenger.
1 Start QuickTest and open the Recording test.
If QuickTest is not already open, choose Start > Programs > QuickTest
Professional > QuickTest Professional.
➤ If the Welcome window opens, click Open Existing.
➤ If QuickTest opens without displaying the Welcome window, choose
File > Open or click the Open button.
In the Open Test dialog box, locate and select the Recording test, then click Open.
2 Save the test as Checkpoint.
Select File > Save As. Save the test as Checkpoint.
3 Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QuickTest window, click the Active Screen button, or choose View > Active Screen.
4 Locate the page where you want to add a standard checkpoint.
You want to add a checkpoint that checks the property values of the First Name edit box after the passenger’s name has been entered in the box.
In the Item column of the Keyword View, expand (+) Action1 > Welcome: Mercury Tours > Book a Flight: Mercury.
The Book a Flight page is displayed in the Active Screen and the object corresponding to the selected step is highlighted. You can see that the passenger’s first name is displayed in the First Name box.
5 Create a standard checkpoint.
In the Active Screen, right-click the First Name box and choose Insert Standard Checkpoint. The Object Selection – Checkpoint Properties dialog box opens.
Confirm that WebEdit: passFirst0 is highlighted, and click OK.
The Checkpoint Properties dialog box opens.
The dialog box displays the object’s properties:
➤ The Name is the name of the object as defined in the HTML code of the Web page.
➤ The Class is the type of object. WebEdit indicates that the object is an edit box.
➤ The ABC icon in the type column indicates that the value of the property is a constant.
For each object class, QuickTest recommends default property checks. The table below describes the default checks.
The first name is entered in the First Name box when the passFirst0 Set... step is performed. Therefore, in the Insert statement area of the Checkpoint Properties dialog box, select After current step. This inserts the checkpoint after the passFirst0 Set... step in which the first name is entered.
Accept the rest of the settings as default and click OK. QuickTest adds a standard checkpoint step to your test below the selected step.

6 Save the test.
Choose File > Save or click the Save button.
You insert most checkpoints in the manner described above. Several special types of checkpoints are explained in the following sections.

No comments: