Share your Katalon Use Cases & Win up to $125! 🎁 Join in now
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:
Note: You can download and use the sample project we used in this course here: https://github.com/katalon-studio/self-healing-demo
00:05-00:22
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.
00:23-00:51
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.
00:52-01:09
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.
01:10-01:33
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.
01:34-01:59
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.
02:00-02:27
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.
02:28-03:13
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.
03:14-03:38
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.
03:39-04:07
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.
04:08-04:37
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.
04:38-05:00
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.
mm
Good and awesome
Good
nice
30-DAY PREMIUM TRIAL