Skip to main content

Generate and Explain code in script editors

Generate code

StudioAssist can generate intelligent automation test code suggestion based on a prompt.

To generate code with StudioAssist, follow these steps:

  1. Open a test case in Script mode.
  2. Provide your code prompt in terms of code comments, single line or block comment. For example, the prompt can be:
    * Write a Katalon Studio test case to perform the following steps. 
    * 1. Open browser to the URL stored in G_SiteURL
    * 2. Click the make appointment button
    * 3. Fill in the username and password fields based on the variables
    * 4. Click the login button
    * 5. Verify that the appointment div exists
    * 6. Close the browser
  3. Select the prompt text. Right-click and select StudioAssist > Generate Code. Generate Code button

Result

StudioAssist then generates the test script below the prompt text:

StudioAssist Code generation results

Explain code

You can select a code snippet and use StudioAssist to explain the code.

To generate code explanation, follow these steps:

  1. Open a test case with existing test steps in Script mode.
  2. Select the the desired code snippet. Right-click and select StudioAssist > Explain Code. Explain Code button

Result

StudioAssist then generates the code explanation below the selected script:

StudioAssist code explanation results
Was this page helpful?