I am going with Option 2
Thank you for making me aware of the concept of Self-Healing Tests. Before answering questions of option 2. I read what is Self-Healing Tests, what is its mechanism, why is it important. Yes, it is time consuming and costly to update ID, XPATHS, CSS on a constantly changing application running via CI/CD pipeline.
Self-healing tests refer to a concept in software testing where automated test suites are designed to not just detect bugs or failures but also attempt to automatically recover from them. The idea is to create tests that can identify issues during test execution and take corrective actions to continue the test process, increasing the robustness and reliability of the testing framework.
Here are some key aspects of self-healing tests:
Automatic Recovery:
When a test encounters an unexpected error or failure, self-healing tests are designed to automatically attempt to recover from that state. For example, if a test script encounters a broken link on a webpage itās testing, instead of stopping the test, it might attempt to refresh the page and try the link again.
Dynamic Adaptation:
Self-healing tests often have built-in logic to dynamically adapt to changes in the software under test. This could involve adjusting test data, modifying the flow of the test, or retrying failed actions with different parameters.
Handling Flaky Tests:
Tests that are prone to intermittent failures, often called āflaky tests,ā can be especially challenging in automated testing. Self-healing tests aim to mitigate these issues by automatically retrying failed tests or actions, potentially with a delay or after performing some other action to stabilize the test environment.
Continuous Monitoring:
These tests may also include monitoring mechanisms during their execution. If a test detects abnormal behavior or a deviation from the expected results, it can trigger actions to rectify the situation while the test is still running.
Risks of Self Healing Tests
While self-healing tests can offer significant benefits in terms of test reliability, efficiency, and maintenance, there are also risks and challenges associated with their implementation. Here are some common risks of self-healing tests:
1. False Positives:
- Incorrect Recovery Actions: If the self-healing logic is not well-designed, it might lead to incorrect actions being taken, resulting in false positives where tests pass despite the presence of real issues.
- Overly Aggressive Recovery: Tests that attempt to recover too aggressively from failures might mask genuine problems, leading to false positives.
2. False Negatives:
- Failure to Detect Real Issues: Conversely, if the self-healing mechanism fails to properly identify and handle certain types of failures, it can result in false negatives where tests incorrectly report success.
3. Complexity:
- Increased Code Complexity: Implementing self-healing logic can make test code more complex and harder to maintain.
- Debugging Challenges: When tests fail, it might be more challenging to debug them due to the added complexity of self-healing mechanisms.
4. Performance Overhead:
- Increased Execution Time: Self-healing tests may take longer to execute due to the additional logic for error detection and recovery.
- Resource Consumption: The additional processing and memory requirements for self-healing tests can strain test environments, especially for large test suites.
How valuable is a feature like this to your team?
I will consider adding Self Healing Tests to my automation suit.
Does anyone know what Selenium Java Lib can be used to implement these healing tests ?
I found this on the internet : Healenium: Self-Healing Library for Selenium Test Automation | by Anna Chernyshova | Geek Culture | Medium
Please help with this request.