Creating an image verification point

You can use an image verification point to test images in your application. When you record the verification point, a baseline image file is created. Every time you play back the script, the image is compared to see whether any changes have occurred, either intentionally or unintentionally.

About this task

Starting from 9.1.1, enhancements have been made to image verification points. Prior to 9.1.1, image verification was strictly a pixel-to-pixel comparison. When a script was recorded on one computer and played back on another computer, the image verification point sometimes failed because of system-level differences, such as screen resolution or differences in the operating system. Now, if a pixel-to-pixel comparison fails, a new image-based algorithm is applied that is more tolerable to minor changes to the image.

The algorithm returns an integer from 0 to 100 that reflects how much the two images correlate. By default, anything above 80 (or 80% correlation) is considered a pass. You can customize this percentage by adding a rational.test.ft.image.correlationaverage flag in the ivory.properties file, for example:

rational.test.ft.image.correlationaverage=70

In this example, anything above 70% correlation is considered a pass.

Starting from 9.1.1.1, HCL DevOps Test UI (Test UI) includes support for using Optical Character Recognition (OCR) with image verification points. This allows you to capture text along with the image.

Procedure

  1. Click the Record a Functional Test Script button on the product toolbar.
  2. In the Recording Monitor, click Start Application to start your test application.
    See related topics about starting the test application.
  3. In the application under test, locate the image that you want to test.
  4. In the Recording Monitor, click Insert Verification Point or Action Command on the toolbar.
  5. On the Select an Object page of the Verification Point and Action wizard, use the Object Finder tool to select the object. Alternatively, if the image is not based on an object that is supported by the functional test application, use the Capture Screen Image tool. This tool captures the full image of the screen.
    See related topics about Select an object page.
  6. On the Select an Action page, click Perform Image Verification Point and click Next.
    This page is not displayed if you use the Capture Screen Image tool.
  7. On the Insert Image Verification Point Command page, perform the following steps:
    1. Accept the default Verification Point Name or type a new name.
    2. Create one of the following types of verification points:
      • Full image: Select this type if the selected object or the full screen was captured using the Object Finder tool or the Capture Screen Image tool.
      • Region of the image: Select this type to capture a region of the image or the object using the Select Region tool. The x and y coordinates and the total width and height of the selected region are captured as the image verification point.
      • Text on the image: Select this type to use OCR to capture the text on the image. Click Select Region, and follow the guidance in the tool for instructions on how to select the region.
    3. Click Next.
      The Verification Point Data page displays the captured image.
  8. Click Finish.
    The verification point is recorded and added to the script.
    Note:

    In the unified report, an image verification point name is displayed in the following format:

    Verify Image <window_name> <verification_point_type> <property_name>

  9. After you record any other verification points or actions, stop your recording by clicking the Stop Recording button on the Recording Monitor toolbar.