Optimize Test Code with Katalon StudioAssist

optimize test code with katalon studioassist

Katalon StudioAssist (now Katalon AI Assistant) turns plain-text comments into test code and explains existing scripts in plain English. Learn how to set it up and get the best results from its generate and explain features.

Key takeaways
The 30-second version of this article
StudioAssist (now Katalon AI Assistant) uses GPT models to generate and explain test code in Katalon Studio.
To generate code, write test steps as a comment that references objects by their Object Repository names.
Explain Code adds a plain-language summary of selected code, which helps mixed-skill teams maintain scripts.
You can use Katalon's AI service or your own OpenAI or Azure OpenAI key.
guide to optimize test code with studioassist

In the fast-moving field of software quality management, Katalon introduced a new feature: Katalon StudioAssist. Powered by GPT (Generative Pre-trained Transformer) technology, it's designed to change how individual contributors work with their existing test code.

Katalon StudioAssist uses AI to explain your existing test code, making it easier to understand, debug, and optimize. It can also generate new code snippets from contextual comments, boosting productivity for developers and testers alike.

Katalon StudioAssist goes beyond code generation. It acts as a companion throughout your coding work, providing real-time assistance and shortening the learning curve for those new to Katalon Studio. By simplifying complex coding tasks, Katalon StudioAssist helps teams of any size scale their testing and deliver high-quality software.

In this article, we share best practices, tips, and tricks to help you get the most out of it in your existing and new Katalon test scripts. Let's dive in!

1. Generate Code

Katalon has always been about enabling every user to contribute to testing with their own skill set. More people generating test scripts means faster, broader test coverage, so potential defects can be caught earlier in the sprint or cycle. That's why the StudioAssist generate code feature lets users turn plain written text into lines of code for their scripts, so people with little automation or scripting experience can still write test scripts.

This may seem like behavior-driven development (BDD), but because StudioAssist uses a large language model, you can write test steps with a much broader and more flexible vocabulary.

Let's go over an example. Please note that to use the generate code feature, you need existing objects in your Object Repository (for example, from a previous Record-and-Playback session). To start, open the Script view of any test case in Katalon Studio.

How To Use It

image8.png

Once there, write your test steps as a comment so the plain text doesn't interfere with compiling the script. A key thing to remember is that the UI elements in the text need to reference objects by their names in the Object Repository. For example, we referenced the text field by its object name, "input_username", which sits in the Object Repository folder "Page_home". This is key when writing a test script with the generate code feature.

The only thing left to do is highlight that section, right-click, and select StudioAssist > Generate Code.

image1.png

Katalon uses OpenAI's GPT models to translate the text into lines of code for your script. Each generated line of code sits next to the line of text it came from, so all users can clearly understand what each step in the test case is doing.

The generate code feature of StudioAssist, like many features in Katalon, lets users apply their own skill sets to create test cases quickly and collaborate with other roles such as automation engineers and developers.

2. Explain Code

Regardless of your technical skills, it’s always easier to read plain text than lines of code. A best practice developers often use is their own documentation in the form of comments for any work that needs to be done so that the next user to contribute can easily interpret the script and quickly make any necessary changes. So it goes without saying that for an environment where business users collaborate with developers the ability to understand step(s) in a test case quickly will lead to faster test creation and maintenance.
 

In StudioAssist, highlight any section or line of code, right-click it, and select StudioAssist > Explain Code.

The explanation appears in plain text below the highlighted section. It doesn't just walk through the code step by step; it also gives an overall summary of what the code does.

Final Words

StudioAssist arrived in Katalon Studio 9.0.0 to help reduce the time it takes to create tests. Using OpenAI's GPT models, it lets you create test code from plain-text descriptions and get detailed explanations of new and existing scripts. StudioAssist has since been renamed Katalon AI Assistant.

Start Testing With Katalon
 

Frequently asked questions

Son Huynh
Son HuynhSupport Engineer

Son Huynh is a Support Engineer at Katalon, based in Ho Chi Minh City, where he helps customers solve technical issues across the Katalon platform. Before joining Katalon in 2025, he spent three years as a Professional Services Engineer at ELCA Vietnam. He studied at California State Polytechnic University, Pomona.

Connect on LinkedIn →
Get started

Test everything. Ship with confidence.

From generating test cases to spotting failures, Katalon's AI works across your entire pipeline, automatically.

Live webinar

The Next Evolution of Manual Testing: Introducing Katalon AI Test Runner

Learn how to grow your QA team's capacity in the age of AI, then watch Katalon AI Test Runner turn manual test cases into automated runs, live.

2:00 to 3:00 PM IST
Almas AhmedSenior Account Manager
Sumit WankhedeSolutions Engineer Manager
Register now