Using Guided Healing to update a test

As applications undergo changes during regression testing, automated tests must be updated. Some changes can be easily detected such as edit box labels, but others can be more difficult to identify, such as the UI control properties. To help users to identify those changes in the application and to fix the test accordingly, more intelligence has been added to test playback. By enabling this feature, new snapshots are captured for all of the test steps during the playback. If an object is not found, it is replaced with the object that best matches its description. When the test execution is complete, the steps are highlighted with colors to identify which of the test steps passed or required some updates.

About this task

This task needs to be performed from the Test Workbench perspective.

The guided healing feature applies to user action test steps only.

Procedure

  1. Execute the test from the Test editor. In the Run configuration dialog box, select Collect data to update test steps to activate intelligent testing (Guided Healing). Web UI data are collected during the test execution, snapshots are taken, and they are used to update the failed steps. If an object is not formally identified during the test run, this is the object whose description matches the best that is selected as the possible candidate. In the Web UI Report, you can see the steps identified with the following message: 'An action has been performed on the most appropriate object'.
  2. In the test editor, click Scan and mark test with latest resultScan and mark test with latest result to see the status of the test steps. In the test script, the failed steps are shown in red color, the passed steps in green color, and the updated steps are in amber color.

    The highlighted colors for test step results can be modified in Window > Preferences > Test > Mobile and Web UI > Test Step Results.

  3. Click the step that is in amber color. The snapshot captured during the playback is displayed in the User action details view under the Step result tab. If the Guided Healing algorithm has identified the element that best matches the object as it is described in the test script, click Replace snapshot and hierarchy to update the test. The new captured snapshot is copied in the Mobile and Web UI Data view under the Screen Capture section. Repeat the instructions for any other step failures that were caused by changes in the UI of the application under test.
  4. Save the test.

Results

The test is updated and can be run with no failures.

Because adding the snapshots to the test increases the size of the test, you might want to remove the snapshots when test development is complete, and no further changes are expected. To remove the snapshots, right-click the test in the Test Contents window and click Delete snapshots and hierarchies.


Feedback