Generate API tests with AI (beta)
The API test case generator (beta) is an AI-powered feature that enables you to generate test cases based on imported OpenAPI / Swagger specifications. This feature offers a quicker and more efficient method to generate API tests, significantly reducing the time and effort needed compared to manual test case creation. In this beta release, the feature supports generating status code verification.
The test case generator currently supports OpenAPI 2 (Swagger) and OpenAPI 3.
Generate API tests
Katalon Studio Enterprise version 9.6.0 onwards.
The Account Admin has enabled AI Control for your Account. See: AI Control.
This guide shows you how to use the API test case generator feature (beta) Katalon Studio. Follow these steps:
The generated API test cases are organized in a single folder of Test Cases.
Known limitations
- Accuracy: generated test cases might contains made-up code snippet. You need to revise the test cases before executing.
- Generation time: Test case generation may take a long time. You should click hide to let the generation process in background.
- Limited test case types: Currently the feature only generates status code test cases.
Error: The error message
No test case is generated
may occur when the request to OpenAI exceeds the token limit of 16,385 tokens in the GPT-3.5-turbo model. This happens when using large test objects, leading to failed endpoint test case generation.
Once the test cases are generated, you need to revise the test scripts to ensure that they can run as expected. For example, the script may use undefined global variable, such as global.baseUrl
, you need to create these variables in Global variables and Execution profile.