Lesson 3: Create verification points

In this lesson, you will record verification points to test objects. Verification points verify that a certain action has taken place, or verify the state of an object.

About this task

You can create a Properties verification point, Image verification point or nine types of Data verification points. When you create a verification point, you capture information about an object in the application to establish baseline information for comparison during playback.

Create a data verification point

About this task

You will record a Data verification point to capture the tree of composers.

Procedure

  1. In the Recording Monitor, click the Insert Verification Point or Action Command button Insert Verification Point.
  2. In the Select an Object page of the Verification Point and Action Wizard, clear the After selecting an object advance to next page option if it is selected.
  3. Use the Object Finder Object Finder) to select the Composers tree in the application. Click the Object Finder and drag it over the tree. While holding down the mouse button, you will see that the entire tree is outlined with a red border and the object name is displayed javax.swing.JTree in a screen tip next to the red border. When you release the mouse button to make the selection, notice that the recognition properties for the object are listed in the grid at the bottom of the Select an Object page.
  4. Click Next.
  5. In the Select an Action page, make sure Perform Data Verification Point is selected and click Next.
  6. In the Insert Verification Point Data Command page, in the Data Value field, select the Tree Hierarchy test.
    This test captures information about the entire tree hierarchy.
  7. In the Verification Point Name field, type Classics_tree and click Next.
  8. The Verification Point Data page displays the captured data in a grid in the right pane. If a check mark appears in the box beside an item, that item will be tested. By default, all items are selected. Leave them checked. If they are not selected, click the Check All button.
  9. Click Finish.

Create an image verification point

About this task

You can insert an image verification point to confirm that the appropriate album is displayed for the selected CD.

Procedure

  1. In the Recording Monitor, click the Insert Verification Point or Action Command button Insert Verification Point.
  2. In the Select an Object page of the Verification Point and Action Wizard, clear the After selecting an object advance to next page option if it is selected.
  3. Use the Object Finder Object Finder to select the Album image in the application. Click the Object Finder and drag it over the album image. While holding down the mouse button, you will see that the album image outlined with a red border and the object name is displayed javax.swing.JLabel in a screen tip next to the red border. When you release the mouse button to make the selection, notice that the recognition properties for the object are listed in the grid at the bottom of the Select an Object page.
  4. Click Next.
  5. In the Select an Action page, selectPerform Image Verification Point and click Next.
  6. In the Insert Image Verification Point Command page, type Album_image as the Verification Point Name.
  7. Make sure that the option Select full image is selected and click Next.
  8. The Verification Point Data page displays the captured image in the right pane. Click Finish.

Create a properties verification point

About this task

You can now insert a different verification point to confirm that the order is for the correct customer. A Properties verification point captures the text in the confirmation screen.

Procedure

  1. In the ClassicsCD application, click Order > View Existing Order Status. Do not click either of the password fields at this time.
  2. Click OK.
    You will test the label "Order for Trent Culpito" in the View Existing Orders window.
  3. In the Recording Monitor, click the Insert Verification Point or Action Command button Insert Verification Point.
  4. In the Select an Object page, select the After selecting an object advance to next page option.
  5. Drag the Object Finder over the label "Order for Trent Culpito" to select it. While holding down the mouse button, note that the label is outlined with a red border and the object name is displayed javax.swing.JLabel).
    After you select the object, the Select an Action page opens because you selected the advance to next page option.
  6. Select Perform a Properties Verification Point, which is the second action from the top, and then click Next.
  7. On the Insert Properties Verification Point Command page, confirm that the Include Children field is set to None.
  8. Under Verification Point Name, accept the suggested default.
  9. Leave the Use standard properties option selected and then click Next.
    On the Verification Point Data page, the test object properties and their values are displayed in a grid format. You can choose which properties to test in the Property column and can edit the property values in the Value column.
    Learn more about selecting object properties: By default, none of the properties are selected. To test object properties, choose the properties that you want to test by selecting each property. The properties you select are tested each time you play back a script with this verification point. You can select all properties in the list by clicking the Check All toolbar button above the grid. Use the Uncheck All button to clear all properties. For best results when using a Properties verification point, test only the properties you are interested in. In this case, only the text property is of interest to determine whether the order is for the correct customer.
  10. In the Property column select the text, opaque, and visible properties to test them during playback. You may have to click the check box twice for the selection to persist.
  11. Click Finish.
  12. In the ClassicsCD View Existing Orders window, click Close.

Test the password fields

About this task

Now let us place another quick order to test the password fields that we did not test earlier.

Procedure

  1. Expand the Haydn folder in the composers tree.
  2. Click Symphonies Nos. 94 & 98.
  3. Click the Place Order button.
  4. In the Member Logon window, keep the default settings of Existing Customer and Trent Culpito.
  5. This time, type xxxx in the Password field.
  6. Select the Remember Password option.
  7. Click OK.
  8. Type a valid card number number and expiration date, for instance, 7777 7777 7777 7777, expiration 06/09.
  9. Click Place Order.
  10. Click OK in the order confirmation message box.
  11. Close the ClassicsCD application by clicking the x button.
  12. Click the Stop Recording button Stop Recording) on the Recording toolbar.

Results

When you stop recording, HCL OneTest UI closes the recording monitor and then writes your script and object map to your project directory. The HCL OneTest UI window is restored and the script is displayed in the main window.