[23] QTP study No.8_Checking Objects
Checking Objects In this section, you will add a standard checkpoint in the Book a Flight page. This checkpoint verifies 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. o If the Welcome window opens, click Open Existing. o If QuickTest opens without displaying the Welcome window, choose File > Open > Test or click the Open button down arrow and choose Test. In the Open Testdialog box, locate and select the Recording test, then click Open. 2. Save the test as Checkpoint. Choose 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. Highlight the Book a Flight: Mercury row. 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 boxand 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: o The Name is the name of the object as defined in the HTML code of the Web page. o The Class is the type of object. WebEdit indicates that the object is an edit box. o 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 for the WebEdit class.
The passenger's 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. In the Name box, enter CheckName as the new checkpoint name. 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. |