šŸ¤– Day 20: Learn about AI self-healing tests and evaluate how effective they are

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.

1 Like

Based on my previous task of trying out the AI self-healing testing feature in Katalon Studio, today I chose Option 1.

1. What kind of problems does your tool claim to solve?

Katalon Studio’s AI-driven self-healing testing feature claims to address issues related to test failures caused by UI locator changes in WebUI automation testing.

The working mechanism of Katalon Studio’s AI self-healing testing:

  • Once self-healing is enabled, if Katalon Studio can’t find an object using the default locator, it attempts to find the object with other pre-configured locators associated with that object.

  • If Katalon Studio finds the object using any alternative locator, the test continues. The alternative locator that successfully found the object is used for the remainder of the execution. This helps prevent repeated self-healing of the same broken object, thus reducing execution time.

  • After test execution, Katalon Studio suggests replacing the broken locator with the one that found the object. Unless Katalon Studio can find the target object, based on designed failure handling options, the test execution may stop or proceed.

The corresponding article link is: https://docs.katalon.com/katalon-studio/maintain-tests/self-healing-tests-in-katalon-studio

2. Verifying one of the claims

To verify Katalon Studio’s AI self-healing testing functionality, I recorded a process on the Swag Labs online shopping website with Katalon Studio, including login, selecting products, adding them to the cart, and successfully placing an order. Katalon Studio generated the following code:

Generated Code

The current demo test case runs successfully.

2.1 Intentionally changing locators to verify the AI self-healing functionality

To test the tool’s ability to detect and repair changes in element locators, I intentionally altered two locators in the test script. The adjusted example is as follows:

Adjusted Example

After the test failed, I checked the tool’s AI self-healing functionality and found no suggestions for locator repair failures.

No Suggestions

No Suggestions

2.2 Intentionally changing the order of steps in the test to verify the AI self-healing functionality

To further test the tool’s ability to repair after detecting changes in element locators, I changed the order of the test steps. The adjusted example is as follows:

Adjusted Order

After the test failed, I checked the tool’s AI self-healing functionality and again found no suggestions for locator repair failures.

No Suggestions

No Suggestions

3. Where might this feature fail?

From what I’ve observed, both of my verifications failed; the AI self-healing testing did not provide any locator repair suggestions, which is a significant deviation from the official claims.

I also attempted to run incorrect demo cases multiple times, and on one occasion, Katalon Studio’s AI self-healing testing feature did provide a suggestion. However, using its advice did not correct the faulty case.

At this point, I’m not entirely sure if there are any specific conditions or limitations to Katalon Studio’s AI self-healing testing feature, or if I’m using it incorrectly.

Note that I am using a trial version, and the AI self-healing testing feature is set to default configuration.

4. My Opinion

Having participated in this 30-day AI testing challenge and trying out many new AI testing tools, I’ve found that most tools do not live up to their claims and often exaggerate their capabilities. I suggest that everyone thoroughly test these AI testing tools themselves and use those trial results as a basis for selecting the appropriate tool.

my blog post link:30 Days of AI in Testing Challenge: Day 20: Learn about AI self-healing tests and evaluate how effective they are | Nao's Blog

5 Likes

Thanks for sharing various examples

Hi there :wave:

Found this interesting article in LinkedIn - Revolutionizing Software Quality: The Era of AI-Powered Self-Healing Test Automation

Yeah, Future is promising and Self heal can bring a lot of benefits in Test Automation development

2 Likes

Hola QAs!

I have considered option 2 as my task:
Blog URL: What is Self Healing Test Automation | BrowserStack
ā€˜Self Healing’: The intelligent process of healing the pre-written code for checking , implementing, and fixing the already written test scripts so that they don’t fail due to any code change. The code change can be any locator change that is used in the test scripts.
Disadvantages:

  1. What if the code change is complex and bigger than just the locator change?
  2. They are not that simple and easy to completely understand the functionality of such tools.
    Useful or not: It seems to be useful for testers so that they can focus on more complex tasks rather than updating their previous test scripts every time the developer changes his/her code so that the pre-written test cases don’t fail altogether.
2 Likes