Applying guided healing feature for tests identified by the image property

When you play back any Web UI tests that use the image property to match target with actual images, the tests fail if there is a mismatch. You can use the guided healing feature that provides the capability of finding the next best matching image so that the tests can pass.

Before you begin

You must have recorded a Web UI test. See Web UI recording.

About this task

The UI of an application might undergo changes during the development phases. When your test does not adapt to the changes in the UI elements, the probability is high that your test might fail. When you enable guided healing feature, during playback, if an object is not formally identified, then the next best matching image is selected as the possible candidate. You can choose to update the images to the test either automatically or manually.

The following procedure describes about updating the images automatically.

Procedure

  1. Run the recorded Web UI test from the test editor.
  2. 2. Select the Collect data to update test steps check box in the Run Configuration dialog box.
    The guided healing feature is enabled.
  3. Select the Automatically update the test at the end of playback check box to update each test step with the identified images.
  4. Click Next, and then click Finish.
    After the test run is complete, the Web UI test report is generated.
  5. In the test editor pane, click the Scan and mark test with latest results icon to view the status of the test steps.
    The test steps and the images highlighted in the test steps are indicated with different colors to specify the status of each test step. You can refer to the following table to understand the meaning of each color:
    Step color Explanation Indication of the test result
    Green During playback, the target object that matched the actual object was found based on the correlation score. The test step is passed.
    Amber During playback, the best matching target object was not found. Then, the next closest matching image was identified as the target object based on the correlation score. The test step is partially passed.
    During the playback, the test steps are updated with the newly identified images.

Results

The test steps are passed and displayed in black color.