Table of contents
1.
Introduction
2.
Refactor Test Objects in Katalon Studio
2.1.
Steps
2.2.
Object References
3.
Configure Failure Handling Settings in Katalon Studio
3.1.
Default Failure Handling Behaviour
3.2.
Override Failure Handling Behaviour
3.2.1.
In Manual View
3.2.2.
In Scripting View
4.
Frequently Asked Questions
4.1.
Is the Katalon runtime engine free?
4.2.
Does Katalon support Java?
4.3.
How do you run multiple test suites in Katalon?
5.
Conclusion
Last Updated: Mar 27, 2024

Test Objects Refactoring and Failure in Katalon

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

Introduction

We all like it when our kitchen is neat and tidy. If our kitchen is messy, we might mix up things that we need with the things that we do not need. We might have unwanted items that might cause trouble cooking properly. We can find a similar scene here too. Test object refactoring gives us the power to check and manage unused test items. Let us find out about it.

Test Objects Refactoring and Failure in Katalon

Refactor Test Objects in Katalon Studio

Test object refactoring is the ability to inspect and manage unused test items, allowing you to see which objects are useful. As a result, you may actively arrange and maintain them. This functionality is crucial for keeping your object repository neat and clear when working on a large and long-term project.

Any Web, Web Service, Mobile, or Windows test object that has not been referenced in a Test Case, Test Listener, or Keyword is considered an unused Test Object.

Note: A Test Object reference is defined as invocations of findTestObject ("test object ID"). If we create a new Test Object programmatically but do not utilise it using findTestObject, it will be counted as "unused."

Steps

Step 1: First, we have to go to the tools option in the top bar.

Step 2: There, we have to go to Test Object and click on Show unused Test Objects. All the unused test objects in our project will be retrieved once we click on it.

go to Test Object and click on Show unused Test Objects

We can get a list of test objects that are yet to be used from the Unused Test Objects Report.

 list of test objects that are yet to be used from the Unused Test Objects Report

Object Repository

By double-clicking the object, we can open its test object view. There we can also inspect and maintain its details. We can also get rid of the outdated and obsolete ones to keep and maintain only the objects we have utilised.

Action to remove all objects that are not needed or unused: We can confirm our action by clicking Delete all. We must be careful because there is no way to recover deleted objects in Katalon Studio. You can keep a backup of such unwanted objects by exporting and importing them with Test Artifact Sharing. This is in case we need them later.

Delete all option  Unused Test Objects Report

Remove selected objects: To remove only a few selected objects in the list, we can right-click on the object we want to remove, select Delete, and confirm the action. 

Object References

Viewing a test object's references reveals where it has been utilised. Right-click the object and choose Show References from the drop-down menu. Katalon Studio looks for the item and returns references to it. To navigate to a corresponding location in that project, we have to double-click on a highlighted reference.

Delete

We should know that the objects that are not used do not have references. They also appear in the Unused Test Objects Report that we have talked about. 

Configure Failure Handling Settings in Katalon Studio

Failure handling settings let users choose if Katalon Studio should continue to run when errors pop up during execution.

Option Description

Default Failure Handling Behaviour

We have to follow the steps below to set the default failure handling behaviour that will be used across our project.

Step 1:  In the Katalon Studio menu, we will go to the Project option and select Settings.

Step 2. We will go to Test Design and navigate to Test Case.

we choose the preferred choice for the Failure Handling default behaviour

Step 3: Now, we choose the preferred choice for the Failure Handling default behaviour. Once we're finished with the steps, we will click on OK.

We should take note that only new test steps will be affected by the choice we are making. This update does not affect the failure-handling options for steps that already exist in our test cases. As a result, we might have to manually update them.

Override Failure Handling Behaviour

We can manually override the default failure handling behaviour for each test step. We can accomplish that in either the Manual or Scripting view of the test case.

In Manual View

Let us take a look at the steps in the manual view.

Step 1: To access the context menu for the step where we wish to change the failure handling behaviour, right-click on it.

 change the failure handling behaviour

Step 2: Now, we will select our preferred failure-handling option.

Step 3: Now, we save our test case. 

In Scripting View

FailureHandling can be added as the final parameter to any built-in keyword in Katalon Studio. We can use any of these options below to specify the behaviour of a keyword while editing it in Scripting mode.

FailureHandling.CONTINUE_ON_FAILURE

 

FailureHandling.STOP_ON_FAILURE

 

FailureHandling.OPTIONAL 

Frequently Asked Questions

Is the Katalon runtime engine free?

Katalon Runtime Engine is a premium item. However, a 30-day trial of Katalon Runtime Engine is available for free. We can register and use it for free for a month to get an idea of how it works.

Does Katalon support Java?

Yes, Java is supported in Katalon. To make it clear, while we are building scripts and/or custom keywords, We can use either Groovy or Java syntax. Groovy is a simple and powerful scripting language that "extends" the Java language.

How do you run multiple test suites in Katalon?

We can do it by clicking Add in the command toolbar. A Test Suite Browser box will be displayed, which lists all of the Katalon Studio test suites. Now we choose the test suites we want to run and select OK.

Conclusion

In the blog, we learned about test objects refactoring and failure in Katalon. We also got to know about refactoring and configuring the related parts of the process. Refer to our courses and explore Coding Ninjas Studio to find more exciting stuff. You can also look into the interview experiences and solve different problems. Look into our Guided paths, test series, libraries and resources to know more.

Thank You

Happy Coding!

Live masterclass