Table of contents
1.
Introduction
2.
Auto-healing Smart XPath
2.1.
Installing the Auto-healing Smart XPath plugin
2.2.
Configuring XPath
2.3.
Create test objects by Recording/Spying
2.4.
Execute test cases with Auto Healing, supported by Smart XPath
3.
Update to the new stable XPath values
4.
Frequently Asked Questions
4.1.
Differentiate between XPath and CSS?
4.2.
What is self-healing in Katalon?
4.3.
What is XPath in Katalon?
5.
Conclusion
Last Updated: Mar 27, 2024
Medium

Auto-healing Smart XPath in Katalon

Author Sanjana Yadav
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hello Reader!! 

We are now familiar enough with Katalon. Today we will talk about Auto-healing in Katalon. We will understand what it means and how it's done. We will also see the plugin called Auto-healing Smart XPath plugin. We will learn to install the plugin and use it in the Katalon Studio.

Auto-healing Smart XPath in Katalon

So, without any further ado, let’s get started!!

Auto-healing Smart XPath

High maintenance costs of test scripts, which are typically brought on by faulty and unreliable locators, are a top issue for testers in Web UI automated testing. A locator is a tool Selenium uses to locate an element when running tests. XPath is a popular locator system. Unfortunately, when the application under test (AUT) changes, locators are readily damaged or fail to recognize the target element.

The effectiveness of Web UI test automation depends on the creation and use of accurate and reliable locators. So let us understand the XPath in Katalon Studio in detail.

Installing the Auto-healing Smart XPath plugin

Below are the steps to download the Auto-healing Smart XPath plugin.

  1. Visit the Katalon store and download the plugin.
Auto-healing Smart XPath

2. Once the plugin has been successfully installed, open the Katalon Studio. Go to the profile button in the top right corner and click on the reload plugins options. 

Reload Plugins

3. Select the Auto-healing Smart XPath button from the main toolbar. If you see Smart XPath Disable, this means that the Auto-healing Smart XPath is currently enabled.

Configuring XPath

Follow the steps below to configure the XPath:

  1. Go to the project option in the main toolbar. Then click on the settings option in the drop-down menu.
Configuring XPath

2. Now, go to test design and open the Web UI option. Inside this, select the XPath option.

Project Settings


The list includes XPath generator sources that provide the appropriate XPath values for the test objects used in Katalon Studio. You may modify the Xpath priority by using drag & drop.

Create test objects by Recording/Spying

When you create the test objects in the test cases by Recording/Spying in Katalon, then a set of XPath values are generated in the prioritized order of the XPath generator provider list. The test objects' default XPath value is the first value in the list.  

Create test objects by Recording/Spying

Execute test cases with Auto Healing, supported by Smart XPath

If a test object cannot be found during execution due to a default XPath value, other XPath alternatives in the list will be automatically used until the test is found. The execution goes on as though there was no failed detection. This dramatically reduces the amount of time needed to update test cases, especially when they are run in batches overnight.

Update to the new stable XPath values

You can modify the provided XPath values to the test objects after execution. Follow the steps below for the same:

  1. Go to Smart XPath and select  Xpath Auto-healing logs.
  2. To update the value, select the Approve checkbox and then click OK. Click Approve all if you want to update all of the values.
  3. After the approval, close the object and reload the Object Repository to view the new XPath values.

Frequently Asked Questions

Differentiate between XPath and CSS?

Because Xpath supports bidirectional flow, traversal can occur both from parent to child and from child to parent. CSS only permits one direction of flow. Hence the only possible traversal is from parent to child. In terms of performance and speed, Xpath is slower. CSS outperforms XPath in terms of performance and speed.

What is self-healing in Katalon?

When self-healing is turned on, Katalon Studio attempts additional pre-configured locators linked to an object when its default locator is unable to locate it. The test continues if Katalon Studio locates an item using any further locators.

What is XPath in Katalon?

XPath is an HTML selector that is used in test automation. Essentially, it is a path formed from some web element or the top tag (body) of an HTML page (absolute XPath) (relative XPath).

Conclusion

Congratulations!! You crossed another level in learning the Katalon Studio. Today, we learned about Auto healing, how to install the Auto-healing Smart XPath plugin and how to use it in Katalon.

We hope that this blog has helped you understand the Katalon Studio and its working. To learn more about Katalon and its several features, you can refer to

 

You can also visit our website to read more such blogs. Make sure you enroll in the courses we provide, take mock tests, solve problems, and interview puzzles. Also, you can prepare for interviews with interview experiences and an interview bundle.

Keep learning and keep growing, Ninjas!

Thankyou
Live masterclass