Table of contents
1.
Introduction
2.
Web testing in Katalon studio
2.1.
Create a new project
2.2.
Create new test cases
2.3.
Verification in the test case
2.4.
Object repository
2.5.
Testing web elements
3.
Self-healing in Katalon studio
3.1.
Self-healing Insights
4.
Frequently Asked Questions
4.1.
What is the difference between Katalon and Selenium?
4.2.
What language does katalon use?
4.3.
What is a Katalon studio engine?
4.4.
Can we do performance testing using Katalon studio?
5.
Conclusion
Last Updated: Mar 27, 2024

What are web testing and self healing tests in Katalon?

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hello there,

As we all know that testing is an important part of development. It lets us know how well the task is being performed before it goes live.

Katalon Studio is a software tool for automated testing. Web, API, mobile, and desktop application testing are uses of Katalon Studio.

katalon logo

In this article, we will get you started with Katalon studio if this is your first time using it. We will go over a few principal steps, basic concepts, and operations in Katalon Studio.

Web testing in Katalon studio

What is web testing?

Web testing is the testing of web applications to ensure they are in the desired state and fulfil all the requirements.
It is an essential practice. It helps to know bugs before the application goes live.
We will learn how to create a web test for your project in steps. We will test “Cura healthcare services” for the same.

Create a new project

The steps to create a new project for web testing in Katalon studio are as follows:

  1. On the home screen of Katalon studio. Click on "New project" on the left side of the page.
  2. A new project text box appears. Fill in the necessary details. 
     
new project box
  1. Select Type- Web. 
  2. Make sure both the checkboxes at the bottom are checked. We will use these further.
  3. Click "ok." 

You will see the basic structure of the project displayed on the screen. 

test cases from test explorer

Note: To get started you can use Katalon sample projects for web testing in Katalon.(In this article we will be using Cura healthcare as an example.) 

Create new test cases

To create a new test case. Click on test case > new > test case.
For more information, read test case management.

You will see a few options at the bottom of your screen.

modes and options for test cases

Look at the manual and script modes in the image.

Manual mode is selected by default in web testing in Katalon. It allows you to create automated tests without much programming knowledge.

You can select the script mode in web testing in katalon. This is for people with high programming language knowledge. This mode provides more control of the test. The script language in Katalon is Groovy.

You use keywords in script mode. They are built-in functions in Katalon studio.
For example, Web-UI stands for web user- interface. It contains a group of methods and classes related to handling actions on the website. 

Once you start typing, Katalon will provide a drop-down of string parameters. These contain URLs for you to navigate.

How to create a test case using a script?

  • Type web-UI.
  • Type the action you need to perform. For example, open a browser.
     
web UI drop-down
  • Katalon will give you a drop-down with string parameters. Choose according to your task. 
  • Type in the necessary arguments in the string. For example Url link to the browser.
     
example for opening a browser
  • Make sure web drivers are updated.
  • Run test case.

Verification in the test case

Verification can be done in manual or script mode. 

There are certain keywords for each type of verification. Keywords are enlisted by Katalon.

Step guide:

  1. Type “web-UI.”
  2. Type “verify.”
  3. Type appropriate keywords attached to “verify” without leaving spaces.
  4. Make sure the keyword is in the title case.
  5. Select string parameters from the drop-down.
  6. Type necessary information. You can use web UI in the parameters as well. In certain cases, it is required.
  7. Run test case. 

For example, we will verify the title of the page. We will adhere to the steps given above.

  • Type “web-UI.” And Type “verify.”
  • Type appropriate keywords attached to “verify.” Here we use ‘Match” 
  • Select string parameters from the drop-down.
     
verify with keyword and string parameters
  • Type necessary information. We use Web-UI with “getwindowtitle” here.
  • We have three parameters. First, for the action. Second, for the title. Third, is a Boolean value to denote a regular expression. (False-not a regular expression.)
     
string parameters
  • Run test case. 

Object repository

The object repository saves all elements you can work on. It contains all page components and objects. 

To capture elements for web testing in Katalon:
1. Click on spy web.
 

spy web

2. An object spy box appears. Fill in the necessary information.
 

object spy window

3. Make sure you select the browser and hit start.

4. Chrome will open with the website home page on the screen.

5. Selector appears as you hover over different elements and web components on the page. It appears at the top or the bottom of the screen.
 

selector window

6. To capture an element, press “alt” + backtick (`.)
Or right-click on the element, select “capture element” from the drop-down.
 

capturing element by right clicking

7. The object spy will display the captured element.

8. You can modify object properties for each element.
 

object spy

9. Click on “Verify and highlight.”

10. Press “save”. Save window appears. Create a new folder in the repository or save it as it is.
 

add element to object repository

11. Close the window. 

Testing web elements

To test web elements for web testing in Katalon:

  1. Click on the object repository.
  2. It will show all the elements stored. Click on the one you want to test.
  3. Re-check the modified settings.
  4. Type “web-UI.”
  5. Type required function. Select the string parameter from the drop-down.
  6. Drag and drop the element from the repository in the string parameter.
  7. Run the test case. 

You can add these test cases to test suites. And run test suites all together to test the whole application. Refer to test case management

Self-healing in Katalon studio

Self-healing in Katalon uses machine learning to keep the tests running.

Any bugs during the test run are resolved automatically in this mode. It implements test execution for the functioning of the test. 
Interacting with the web elements, waiting for the system response. And carrying out the next actions are all done for you by self-healing.

Self-healing helps you reduce test flakiness. It provides backups for a broken or missing object locator when it fails to locate a web element.
You can update the broken objects with new locators with just a few clicks. This makes test maintenance easier.

Steps guide to enable self-healing:
1. Click on “project” in the top menu bar of the window. 

2. Go to settings.
 

self healing by project settings

3. The project Settings box appears.
 

project settings windows

4. Move up and down the paths of tests to prioritize them. If one path fails, the next one is executed.

5. Click “apply and close” once you have modified it. 

OR

You can enable and disable self-healing. And also modify the setting by clicking on the self-healing button on the top menu bar.

self healing button
 

The longer the tests are the flakier it gets. A good practice is to break down long tests into smaller test cases.

Self-healing Insights

In the log viewer, you can see the steps followed by katalon for self-healing the test cases. Click on a test case and it will give you insight into how the broken element was located.  

 

self healing insights

The self-healing insight box shows a tabular form of these steps.
You can approve or deny permanently making the locator changes in this insight box.

The self-healing insight table consists of:

  • Test Object ID:  ID of broken test objects.
  • Broken Locator: The default locator that failed.
  • Proposed Locator: The alternative locator that located the object during execution by self-healing.
  • Recovered By: The Selection Method used to locate the object.
  • Screenshot: When finding an object with its alternative locator, Katalon will capture a screenshot of the test object for you to verify whether the found object is the wanted one. Click Preview to check the healed object.
  • Select: choose the locator you prefer.

Frequently Asked Questions

What is the difference between Katalon and Selenium?

Selenium is faster than Katalon, but the difference in speed can only be seen if the test cases are too long.

What language does katalon use?

Katalon uses Groovy language, which is built on top of java.

What is a Katalon studio engine?

Katalon Studio engine is an add-on to Katalon studio, which helps you execute automated tests by command-line interface mode.

Can we do performance testing using Katalon studio?

Katalon Studio is not a performance testing tool but provides one feature for performance testing: Max concurrent instances.

Conclusion

We have learned in depth about web testing and self-healing tests. We also learnt about how to test web applications and how to enable self-healing.

Do you want to know more about katalon studio and how it works?

Do not worry coding ninja has got you covered. You can refer to open source guide

Please refer to our guided paths on Coding Ninjas Studioresources on Coding Ninjas Studio, and Coding Ninjas Studio Library to learn about many more amazing topics also, enroll in our courses and refer to the mock test and problems available. Have a look at the interview experiences and interview bundle for placement preparations.

Do upvote our blog to help other ninjas grow.

Happy Learning!

Live masterclass