Overview of guided healing and self-healing
As web applications undergo changes during regression testing, the application GUI is frequently modified and the regression tests must be updated to identify possible issues, and to ensure that the new code has not affected other parts of the software. Some changes can be easily detected such as edit box labels, but others can be more difficult to identify, for example, the UI control properties. To help testers to identify those changes in the application and to fix the Web UI tests accordingly, more intelligence has been added to test playback with the guided healing and self-healing features.
- UI Test perspective of HCL OneTest™ UI
- Command line of HCL OneTest™ UI
Guided healing and self-healing through the UI Test perspective
To enable the guided healing feature, you must select the Collect data to update test steps option when you run your test. Thus, data is collected during the test run. If an object is not found, HCL OneTest™ UI identifies the object that best matches its description as a possible candidate to replace the missing element and a snapshot is taken. When the test is complete, the steps are highlighted with colors to identify which of the test steps passed and those that require updates. Then you can check the status of each step in the edited test and update the steps manually.
Another option is available from HCL OneTest™ UI v10.0.0 to enable automatic update of the tests. It is the Automatically update the test after the end of the execution option in the Run configuration wizard that is known as the self-healing option. It must be selected when you run your test and enable the guided healing option. Thus, when the test execution is complete, the test steps are automatically updated and the tester has no change to make. It applies to Web UI tests and also to compound tests from HCL OneTest™ UI v10.0.1. When you choose this option for a compound test, all the Web UI tests are self-healed. The hierarchy and snapshots are captured. But at the end of the execution, the amber steps are automatically updated. The self-healing feature is particularly useful when you have numerous test cases that remain re-usable for successive regression cycles.
Updating tests manually can be carried out as a first testing phase prior to starting using the self-healing feature. You can update tests manually first to verify that the test steps are updated with the best candidates identified during the playback. You can then proceed with updating tests using the automation feature.
Self-healing through the command line
You can run tests with the self-healing feature enabled from the command line by using the protocolinput option with the autoheal attribute set to true. The autoheal attribute supports collection and auto-modification of the test data.
The sample syntax is as follows:
cmdline -workspace <workspacename> -project <projectname> -suite <suitename> -exportlog <exportlogpath> -results autoresults -protocolinput "autoheal=true"