Table of contents
1.
Introduction
2.
Fixing Web Test Objects
2.1.
Time Capsule
2.2.
Failed Test Case Execution Scenario
3.
Class Decompiler
3.1.
Configuring Class Decompiler
4.
Frequently Asked Questions
4.1.
What are the methods used to detect web elements in Katalon Studio?
4.2.
What is the Spy Web Utility?
4.3.
What are the different ways to debug failures in Katalon?
5.
Conclusion
Last Updated: Mar 27, 2024
Easy

Class Decompiler and Fixing Web Test Objects in Katalon

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

Introduction

Hi there!

Sometimes you may encounter a situation where a test may fail as the web test object locator could not find WebUI objects. These broken web test objects can be fixed by restoring the application's state by opening a Time Capsule. In this blog, we shall learn how the time capsule helps maintain test scripts. 

Class Decompiler and Fixing Web Test Objects in Katalon

Fixing Web Test Objects

Katalon provides Self-healing to automatically prevent test failures due to broken locators. For Broken web test objects that aren't fixed by the Self-healing feature, Katalon offers Time Capsules that capture the state of your application when a test fails.

Time Capsule

Time capsules usually work only on Web UI objects. The feature is available only for Katalon versions 7.8 and above. The Time Capsule is enabled by default for versions below 7.8.2. Versions above 7.8.2 offer the ability to ON/OFF the Time capsule. Disabling it will not install the Time capsule extension or generate the time capsule. To enable or disable the Time capsule navigate to Project > Settings > Execution > WebUI. Choose to enable or disable the Default Time Capsule option and click on Apply.

Enable/Disable Time Capsule

Failed Test Case Execution Scenario

Consider a failed test case execution scenario where a test case fails due to a broken locator, as shown below.

Failed test case execution

Click on Click here to fix broken Test Object.

The Time Capsule displays the visual aspects of your application to easily capture objects and find broken locators. The Object Spy window shows the locator involved and the object properties. After rectifying the mistake causing the error, click on Verify and Highlight.

Object Spy window

Click on Save to retain the changes made. After reviewing the details, click on OK in the Add Element to Object Repository window.

Save modifications made in Object Spy

Run the test case again to view the final result.

Successful test case execution

This is how you can use the Time Capsule to fix broken Web objects in Katalon.

Class Decompiler

Debugging Test scripts are essential. This mainly requires attaching the source code to a class file in Katalon Studio. These class files are automatically decompiled in Katalon versions 7.9 and above. 

Searching and attaching the source code is not done manually. If this function does not happen due to internet issues or the jar file not being found, Katalon Studio decompiles a class file and displays the source. The Decompiler is enabled on all Katalon instances by default and provides additional configurations for debugging. 

Configuring Class Decompiler

To configure the Katalon Class Decompiler go to Windows > Preferences > Java > Decompiler. We can select the default Decompiler from a list showing CFR, FernFlower, JD-Core, Jad and Procyon. The window also shows the Decompiler, Formatter and Sorter settings.

Decompiler options

To disable the Decompiler:

Step 1: Expand the General options in the Preferences window and select File Associations under Editors. 

Step 2: Select the *.class and *.class without source options and choose Class File Viewer under Associated Editors. Click on Default.

Step 3: Click on Apply and Close.

Disabling class decompiler

Frequently Asked Questions

What are the methods used to detect web elements in Katalon Studio?

Attributes can be used to specify the properties of an object in the Properties Grid. XPath, CSS selectors and Images can also be used to detect web elements.

What is the Spy Web Utility?

The Spy Web Utility help capture object for web testing using the Object Spy window. Through this, we can specify properties and locators for the test objects.

What are the different ways to debug failures in Katalon?

Investigating error logs, enabling debug mode for complex scenarios and Manual debugging using the Recoding feature.  

Conclusion

This blog discusses fixing broken Web Test Objects using Time Capsule in Katalon. It also explains the Class Decompiler and how to configure it for debugging. Check out our articles on Generate Test Steps in Manual and Script View, Sample API tests project in Katalon and Search and Call Test cases in Katalon.

Explore our Library on Coding Ninjas Studio to gain knowledge on Data Structures and Algorithms, Machine Learning, Deep Learning, Cloud Computing and many more! Test your coding skills by solving our test series and participating in the contests hosted on Coding Ninjas Studio! Looking for questions from tech giants like Amazon, Microsoft, Uber, etc.? Look at the problems, interview experiences, and interview bundle for placement preparations. Upvote our blogs if you find them insightful and engaging! Happy Coding!

Thank you

Live masterclass