KShare | How Katalon's StudioAssist Enhances your Testing Workflow

Hi Community members, :wave:

Have you ever wondered how much easier automated testing could be with an AI-powered assistant at your side?

Katalon Studio introduces StudioAssist, your new AI-powered sidekick designed to revolutionize your automated testing experience. Built on OpenAI’s GPT API, StudioAssist empowers you to write and understand test code with unprecedented ease and efficiency.

Key features of StudioAssist :bulb:

  • Intelligent Code Generation: Craft automation test code effortlessly by providing StudioAssist with clear, contextual code comments as prompts.
  • Code Explanation: Unsure about a specific code block? StudioAssist sheds light on its functionality with clear explanations.

Optimizing StudioAssist Usage :office_worker:

To maximize the benefits of StudioAssist, please keep the following in mind:

  • Prompt Formatting: Structure your prompts in a specific format to ensure StudioAssist interprets your requests accurately.
  • Context is Key: Provide relevant context within your prompts to allow StudioAssist to generate the most fitting code or explanation.

:point_down: You can see an example prompt below :point_down:

/* Write a Katalon Studio test case to perform the following steps:
 * 1. Open the browser and navigate to the URL stored in the GlobalVariable `G_SiteURL`.
 * 2. Click the "Make Appointment" button with the ID: Object Repository/Page_CURA Healthcare Service/a_Make Appointment.
 * 3. Fill in the username field using the value from the GlobalVariable `username` with the ID: Object Repository/Page_CURA Healthcare Service/input_Username_username.
 * 4. Fill in the password field using the value from the GlobalVariable `password` with the ID: Object Repository/Page_CURA Healthcare Service/input_Password_password.
 * 5. Click the "Login" button with the ID: Object Repository/Page_CURA Healthcare Service/button_Login.
 * 6. Close the browser.
 */

Steps to Enable Katalon’s AI Features for your Organization

:information_source: Notes: You need to be the Organization Owner for the account.

  1. Login to Katalon TestOps
  2. From the Katalon Platform homepage, click on the Settings icon in the upper-right corner of the page.
  3. Click on the Organization Name at the upper-left corner.
  4. Navigate to Account Settings.
  5. Enable AI Control.

Generate Code using StudioAssist

Below is an example of how you can generate code using StudioAssist right within Katalon Studio.

  1. Open a test case in Script Mode
  2. Provide your code prompt in terms of comment. For example:
/* Write a Katalon Studio test case to perform the following steps:
 * 1. Open the browser and navigate to the URL stored in the GlobalVariable `G_SiteURL`.
 * 2. Click the "Make Appointment" button with the ID: Object Repository/Page_CURA Healthcare Service/a_Make Appointment.
 * 3. Fill in the username field using the value from the GlobalVariable `username` with the ID: Object Repository/Page_CURA Healthcare Service/input_Username_username.
 * 4. Fill in the password field using the value from the GlobalVariable `password` with the ID: Object Repository/Page_CURA Healthcare Service/input_Password_password.
 * 5. Click the "Login" button with the ID: Object Repository/Page_CURA Healthcare Service/button_Login.
 * 6. Close the browser.
 */
    1. Select the prompt text. Right-click and select StudioAssist > Generate Code. You can also use the hotkeys, Ctrl + Shift + C for Windows or ^ + + C for macOS:

Explain Code using StudioAssist

Below is an example of how you can use StudioAssist to explain a block of code within Katalon Studio

  1. Open a test case with existing test steps in Script mode.
  2. Select the desired code snippet. Right-click and select StudioAssist > Explain Code. You can also use the hotkeys, Ctrl + Shift + E for Windows* or ^ + + E for macOS.

Key benefits of using StudioAssist

  1. Faster Testing: Automates test script creation by translating natural language into code, reducing manual effort and saving time.
  2. Better Code: Generates well-structured, clean, and maintainable code following best practices and coding standards.
  3. Easier Understanding: Explains code snippets and simplifies complex code blocks for improved comprehension.
  4. Improved Collaboration: Enhances communication among team members, streamlines code reviews, and promotes knowledge sharing.
  5. AI-Powered: Utilizes OpenAI’s GPT for intelligent code generation, with continuous improvements for smarter capabilities.

Current limitations of StudioAssist in Katalon Studio

  1. AI Hallucinations: It may generate code with nonexistent keywords that require manual revision.
  2. Lack of Context Awareness: StudioAssist cannot access test object libraries, variables, custom keywords, or project-specific data.
  3. Programming Knowledge Requirement: Users need coding and debugging skills to correct and adapt the generated code.

Reference

:information_source: Please refer to our documentation for more information on using StudioAssist: https://docs.katalon.com/docs/proof-of-concept/studioassist-in-katalon-studio


If you find this article helpful, then don’t forget to leave us a like :+1: or a heart :heart:, and share it with your colleagues and teammates. We greatly appreciate your support for the KShare series!

2 Likes

Thank you very much for the Product Support team (@support.squad) and Mohammed Jabir (@mohammed.jabir) for a comprehensive article on StudioAssist!

Mohammed Jabir (@mohammed.jabir) - Junior Product Support Specialist, Katalon
Jabir is a Junior Product Support Specialist at Katalon, a role that allows him to leverage his technical prowess to provide intelligent solutions to our users. His commitment to exceptional support goes beyond simply answering questions; he strives to create a positive and empowering user experience.

:clap: Nice article!

I’ve been experimenting with StudioAssist a bit, and I’d say the lack of context awareness is its most significant limitation when it comes to reducing scripting effort.

Imagine simply writing:

Click on a button named “My_button” that could be located using this XPath: //button[@id='button_1']

…and then having StudioAssist automatically generate not only the keyword line but also the test object itself with the XPath property set. :exploding_head:

Thanks for sharing!

2 Likes

Thank you for the Nice Share Product Support team!!

1 Like