- 15 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Enabling Self-Healing Plugin
- Updated on 15 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Overview
pCloudy has integrated a new plugin to enable Self-healing of various automation and simplify the work of automation engineers. Many times during automated web testing, several test cases fail due to updated builds and changes in the web elements and locators. However, with the new self-healing plugin we can now ensure that these changes are automatically updated on the script for a successful Web UI testing and execution. This feature is compatible with Appium automation scripts, automatically repairing scripts whenever changes occur in web elements or object locators, making the scripts more reliable and easier to run.
Some advantages of the new Self-Healing Capability -
Improve Stability of Scripts
The self-healing capabilities heals the scripts with the updated web elements or object locators when there are changes made in the development.Reduces Maintenance
A lot of times, automation engineers spend hours and days just trying to fix their automated scripts due to failure. With this new self-healing capability, automation engineers can now automate the maintenance effort using the AI based Self-Healing capability.Enables Efficient CI Pipelines
With stable automation scripts that are constantly being updated with the developmental changes, successful automation tests help move faster along the CI pipeline. Making the entire app development process much more stable and efficient.
Limitations
- Supported platform for Android and for native apps only.
- Supported Attribute value: id
Prerequisites
- Users should be registered on the pCloudy platform.
- Users should have one stable build and a recent build to compare
Steps
1. Run your suite on a stable build, including the following capabilities:
// Mention application name capabilities.setCapability("appium:pCloudy_ApplicationName", "Version1.apk");
// Set appium extract as true. This will extract the locator of any elements. capabilities.setCapability("appium:extract", true);
// Set ProjectName capabilities.setCapability("appium:project", "healing7");
// Set the build name capabilities.setCapability("appium:build", "test7");
This step extracts locators from the recent build.
2. Run the recent build on the Self-healing engine 4-5 times to train the AI model:
// Recent application name. capabilities.setCapability("appium:pCloudy_ApplicationName", "build-2.apk");
// Setting this capability as true will heal the locator changes from the recent build. capabilities.setCapability("appium:healing", true);
// Set ProjectName capabilities.setCapability("appium:project", "healing7");
// Set the build name capabilities.setCapability("appium:build", "test7");
3. Execution Process:
- The execution will run successfully and throw an error initially, which will be handled due to self-healing.
- The execution will run again with any new objects or web elements and successfully complete the test execution.