Give AI your OpenAPI spec. Get a full API test suite back

BEST PRACTICES · AI & PRODUCTIVITY

Most API tests only check the happy path. This guide shows how Katalon Studio’s AI reads your OpenAPI spec, tests hundreds of scenarios for you, and tells you what is wrong with your API.

Katalon Studio 11.5 · API testing · Beta feature · September 2026


1. Is this you?

  • ✓ You have an OpenAPI (Swagger) file, but your API tests cover only a few endpoints.
  • ✓ Your tests check that the API works — but not what happens when someone sends bad data.
  • ✓ Security checks, like missing authentication, are “on the list” but never done.
  • ✓ Writing request after request by hand is slow, so coverage stays low.

2. The short answer

If you only read one part, read this.

:blue_book: Your spec is the input :high_voltage: Hundreds of tests in minutes :bullseye: Real problems, clearly explained
Import the OpenAPI file you already have. No test writing up front. AI creates and runs positive, negative, security and edge case tests for you. The report shows what failed and why — then you keep only the tests worth keeping.

3. How it works

Five steps, and the AI does the heavy work in the middle.

:play_button: Watch: Generate API tests with Katalon Studio’s AI About 3 minutes · https://www.youtube.com/watch?v=wCgGz5TtK-A&feature=youtu.be


4. Step 1 — Import your OpenAPI spec

Katalon turns your spec into an API collection, with one request for every endpoint.

  1. In Tests Explorer, right-click Object Repository and choose Import.
  2. Select your OpenAPI / Swagger file (JSON or YAML).
  3. A new API collection folder appears, with a request for each endpoint.

5. Step 2 — Choose what to test

Double-click the collection and open the Generate Test tab. Then pick three things.

TEST TYPE WHAT IT CHECKS EXAMPLE
Positive The API works as designed Add a valid pet — it is saved
Negative Bad input is rejected properly Send an empty name — the API returns a clear error
Security Protection is in place Call a protected endpoint without a key — access is denied
Edge case Limits and unusual values Send the longest allowed value
  1. Test types — tick the ones you want. The demo used Positive, Negative and Security.
  2. API paths — pick the endpoints that matter. If you pick none, all paths are used.
  3. HTTP methods — for example GET, POST, PUT and DELETE.


Server URL, test types, paths and methods — all read from your spec.

Point it at a test server. The AI really calls your API — including sending wrong data and trying to add or delete records. Use a test or staging environment, not production.


6. Step 3 — Let the AI generate and run the tests

Click Generate Test. The AI writes the tests and runs them straight away. Click Hide to keep working while it runs.


The summary: how many tests ran, and how each test type did.

In the demo: 209 tests ran against the public Petstore API in minutes — 31 positive, 153 negative and 25 security tests.

Don’t panic at the red numbers. The 149 errors are problems the AI found in the demo API, not failures of Katalon. Finding them is the whole point.


7. Step 4 — Read what the AI found

Click View detailed HTML Report. This is the part your developers will love.


One score for how well the API follows its own spec — broken down into schema, security, response codes and authentication.

  • ✓ AI-detected issues — the biggest problems, ranked by severity. In the demo: a pet could be deleted without an API key, and bad input caused server errors (500) instead of clear messages.
  • ✓ Recommendations — what the team should fix first, written in plain language.
  • ✓ Every single test — with its scenario, result and reason. Expand one to see exactly why it failed, so a developer can reproduce it.


AI-detected issues, marked Critical or High.


One test, expanded: what was sent and why it failed.


8. Step 5 — Keep the tests worth keeping

So far, nothing was added to your project. Now you choose what stays.

  1. Back in Katalon Studio, click Generate Katalon Test Case.
  2. Pick the scenarios worth maintaining — for example, the security and key negative tests.
  3. Katalon creates readable test cases in their own folder under Test Cases.
  4. Add them to a test suite and run them with every build.


Kept scenarios become normal Katalon test cases.


The tests share the request objects — update one, and every test that uses it follows.

Tip: save the test configuration. After your developers fix the issues, re-run the same setup and compare the results side by side.


9. Tips for better results

  • ✓ Start small. Pick a few important endpoints first, then widen the scope.
  • ✓ Always include Negative and Security. That is where most real problems hide.
  • ✓ Keep your spec up to date. The AI tests against what the spec promises — an old spec means wrong expectations.
  • ✓ Share the report with developers. Each issue comes with a clear reason, so it can go straight into a ticket.
  • ✓ Keep fewer, better tests. Save the scenarios that protect important behavior, not all of them.

10. Myths, cleared up

MYTH “Lots of errors means the tool doesn’t work.”
FACT The errors are problems found in the API under test. A clean API gives a clean report.
MYTH “The AI will fill my project with hundreds of files.”
FACT Generating and running tests adds nothing to your project. Only the scenarios you choose become test cases.
MYTH “I need to write test cases before AI can help.”
FACT Your OpenAPI spec is enough. The AI reads the endpoints, fields and rules from it.

11. Get started

  • ✓ Katalon Studio 11.5 — AI API test generation is a beta feature.
  • ✓ A Katalon Studio Enterprise license to use Katalon AI out of the box, or your own AI provider key.
  • ✓ An OpenAPI file and a test server you can safely call.
  • ✓ Header-based authorization is supported today. Other types, such as NTLM or Digest, are not yet included.
TOPIC KATALON DOCS
AI API test generation Generate API tests with Katalon Studio’s AI (beta)
AI features and licensing Katalon AI Assistant Overview
Web UI tests from files or Jira Best practice guide: Your tests already exist. Let AI turn them into automation.
How AI is controlled in your account Best practice guide: AI in Katalon Studio: how it works, and how you stay in control

Katalon — Best Practices Guide. Applies to Katalon Studio 11.5. Beta features and screens may change. Results shown come from a public demo API (Swagger Petstore). Questions not covered here? Contact the Katalon Onboarding & Adoption team at onboarding@katalon.com.

this should be a life saver for developers

AI API test generation (beta): three problems when saving tests

Hi team, I tried the new AI API test generation on the Petstore spec (https://petstore3.swagger.io/api/v3/openapi.json) in Katalon Studio 11.6 on Windows 11. Generating and running the tests worked well, but the “save as test case” step had a few problems:

1. Some tests won’t save.
Saving failed with FilePathTooLongException (261/255). My project is in the default location, so I wasn’t doing anything unusual. It turns out the AI uses the whole scenario sentence as the folder name. I got around it by creating a configuration with a short name first, but nothing tells you to do that.

2. Test names are hard to read.
The names come out like “Test 1 Iterate through each possible enum values and send happy flow requests. Current field status REPLACE with available”. In reports, with the folder path in front, they’re very long. “REPLACE with” also looks like leftover template text. Short names, with the full scenario in the description, would be much clearer.

3. Saved tests fail even though they passed during generation.
This is the big one. The saved script replaces the whole request body with just the changed field ({"status":"available"}), so required fields like name and photoUrls are dropped. It also doesn’t set the content type to JSON. The test then gets a 400 or 500 instead of 200. The AI shows these tests as passed, but they fail as soon as you run them yourself.

I’d expect the saved test to send exactly what the AI sent. Happy to share screenshots or the project if that helps.

Some real time console logs should be displayed when it is generating test cases, so user knows what is happening.

Yes, these issues needs to be addressed.