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
- Click the Record a Functional Test Script button on the product toolbar.
-
In the Recording Monitor, click Start Application to start your test
application.
See related topics about starting the test application.
- In the application under test, locate the image that you want to test.
- In the Recording Monitor, click Insert Verification Point or Action Command on the toolbar.
-
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.
-
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.
-
On the Insert Image Verification Point Command page, perform the following
steps:
-
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>
- After you record any other verification points or actions, stop your recording by clicking the Stop Recording button on the Recording Monitor toolbar.