Katalon Studio: Self-Healing Mechanism in Test Automation

Course Level




Total Chapters



Course content

3 Chapters30m
This chapter explains how Self-Healing works and its capabilities in Katalon Studio. We’ll run a quick demo on how it fixes broken objects’ locators during a test suite collection’s sequential and parallel executions.
Self-Healing Mechanism in Test Automation

This course demonstrates how Katalon Studio fixes broken object locators during test executions, without any manual effort involved. Equipped with Self-Healing, Studio automatically finds and uses pre-configured alternative locators to identify web elements, preventing tests from breaking.

During 3 chapters, you will learn about:

  • The mechanism and capabilities of Self-Healing
  • Selecting and prioritizing different object locating methods, namely Xpath, Attributes, CSS, and Image
  • Automatically replacing broken locators with new working alternatives
  • How Self-Healing works in detail for different scenarios, including complex end-to-end tests

Note: You can download and use the sample project we used in this course here: https://github.com/katalon-studio/self-healing-demo

Chapter 1 - Self-Healing Mechanism in Test Automation

Self-Healing Mechanism in Test Automation


Hi and welcome to the first chapter. Let's start off with the mechanism of Self-Healing, how it really works to reduce the flakiness of your tests, before jumping into all the details and demos. The sample project that I will use in this course can be found in the Course Overview section for you to download.


With Self-Healing enabled, when Katalon Studio fails to identify an object via its default locator, it will continue to search for other pre-configured alternative locators to interact with that object. Thanks to this, the test execution can still be running rather than failing due to Unable to Find Element errors. Once the broken-locator object is ''self-healed,'' Studio will automatically continue to apply the working alternative for the remaining tests in the same execution time.


After your tests have completed executing with the final status as pass, the alternative locator will be proposed as a permanent replacement for the broken one. And with a simple click of Approve, it will be automatically updated as the new test object locator, without having to change anything in the relevant test cases.


Looking at this demo, what I have here is a test suite collection, including 3 test suites, each containing a typical automated end-to-end test case. They all interact with the same web elements, which are the Book Appointment button, Password textbox, and the Booking button. Now, let's run this test suite collection in both the sequential and parallel mode with Self-Healing on, and see how it goes.


First off, sequential execution. Running tests sequentially just means that each test will run one by one, where the following test case or test suite will start running once the one before it has finished. What's going to happen is the broken object locators in test case number 1 will be automatically healed with the replacement of new working locators. And the working alternatives will continue to be used for 2 other test cases during the runtime.


Our execution is finished. Let's check the Log Viewer, starting off with the first test case. The Book Appointment button in step 3 was initially not found by the default Xpath. So, Katalon Studio located and applied another Xpath alternative, which has prevented the test from failing. Same thing for the Password textbox in step 5 here.


Moving onto the next suite, the second test case. Steps 3 and 5 automatically used the working locator for the elements (the button and textbox) which were healed in the previous test suite. And at step 13, the object was identified for the first time, so the process of Self-Healing was triggered instantly. Finally, in the last test suite. Since every broken object had been healed in the first two suites, it simply used those working alternatives to run the test, without having to go through the Self-Healing process again.


Let's move to the Self-Healing Insights tab! You can then see the list of alternative locators for the 3 broken objects. If you want to use them as the new default locators for corresponding elements, simply click on the Approve button. After the update, if you run this test suite collection again, even with Self-Healing turned off, the tests would still run successfully, without any broken object issues.


Now, what would happen if the test suites run in parallel? Will Self-Healing still work fine? Or it will fail? Let's find out by running this collection in parallel mode. Simply switch it to Parallel, and execute. Alright, they are up and running. What's happening is these tests are being executed simultaneously, and whenever a test step encounters a broken object first, it will be independently ''healed'' with a working alternative locator.


The following steps in the same test case, or in other test cases will know to interact with the same element that was previously healed with a new locator, rather than starting to self-heal again. As you can see here, all the test suites have passed. Like previously, you can also have the option to update the broken locators with the proposed alternatives. Although the way that it operates is slightly different from the sequential mode, Self-Healing can still work perfectly fine in parallel executions without duplicating the work.


That's the end of our quick demo of the mechanism. All in all, Self-Healing saves you tons of time, not only for execution stability but also for your test maintenance, especially when your web application and its front-end elements go through frequent changes or updates in Agile projects.

Chapter 2 - Setting Up Alternatives for Broken Locators

Chapter 3 - Working With Self-Healing in Katalon Studio


Materials include

  • 30 minute on-demand course

  • Lifetime access

  • Sample project

  • Certificate of completion

    Coming soon