intermediate·9 min read·Updated

Automate API Testing with Artificial Intelligence: Run Triage (Part 1)

A run ends with a page of failures. Is it one problem or ten? Read how Run Triage groups them into causes with fixed rules, what each of the five verdicts allows, and how to check the evidence before you act.

This is lesson 9.11, part 1, of Shift-Left API in Depth, the product track of the learning center. In lesson 9.10, you put tests into a Test Run Pack and ran it. This time, some tests fail. Run Triage is in every edition of Shift-Left API, but Test Run Packs and their full reports come with Professional, Enterprise and the 15-day trial. The AI parts need an AI provider. The demo project is made from the sandbox store API, and its failures are staged with the sandbox's simulated errors.

How do you automate API testing with artificial intelligence after a run fails?

To automate API testing with artificial intelligence, start where the time goes: a run with a page of failures. Is it one problem or ten? Is it your tests, your data, the environment or the API itself? Run Triage groups the failures into causes and gives each one a verdict:

VerdictWhat it meansWhat it allows
EnvironmentA credential, gateway or throttling is in the wayNo test changes
Likely product bugThe API failed on a request that should have workedTests stay exactly as they are
Tests out of dateThe API moved and the tests did notA fix can be proposed
Test dataAn id or value doesn't exist hereA fix can be proposed
Needs a lookNot enough evidence yetYou can say what it really is

Grouping and verdicts come from fixed rules that use no AI and change nothing. Where the project allows it, AI can word the summary, take a second look at causes no rule explained, and propose one fix for a whole cause, within the project's AI budget.

Where does triage appear?

In Execution, run your pack with Run Now. When it ends, the Pack Execution Summary shows What failed, and why under the counts, with no click from you. The headline says how many tests failed and how many causes they come down to.

Click View results. The report shows the same analysis, folded above the Execution Summary. With AI set up, it can word the headline. Without it, a plain sentence says the same. Recheck works the run out again, which helps after you fix an environment. Click the headline to show the causes.

How should you read the causes?

Causes are ranked: environment problems first, because they can explain the rest, then likely product bugs, then whatever touches the most tests. Each card has a rank, a verdict, a title, its scope, a short explanation and a hint. If AI took a second look, a note beside the verdict says so and how sure it is.

Below, By endpoint rolls the causes up for each API. A cause tagged Intermittent fails on some runs and passes on others. If the target never answered, a warning says nothing was actually tested, and nothing in that run is repaired.

What is inside a cause?

  1. Open a cause. Why we think this lists the facts behind the verdict, and What to do gives the next step.
  2. Scroll to What it looked like for up to three real examples: what was sent, what came back, and expected against actual.
  3. Use Open to go to the test.

In the demo, the throttled cause offers no change to the tests, on purpose: a test that expects throttling would pass only while the API is throttled. A likely product bug says its tests were left as they are, because accepting that response would hide the problem. With Jira, Azure DevOps, GitHub or GitLab connected on the Security screen under Ticketing, you can raise it as a defect. The response stays out of the ticket unless you tick to include a few lines, because it may hold personal data.

Can you question or correct a verdict?

Yes. Use Ask about this cause to ask a question, or tell it what the evidence can't show, such as a record deleted on staging. Your hint is kept and reaches fixes prepared later. If it reads the cause differently, it offers a new verdict for you to accept. AI answers vary, so read each one as evidence.

This is not what happened lets you say what the cause really is and add a note. Marking it a product bug or an environment problem removes the offer to fix its tests.

Try it yourself

Run a pack that has some failures and click View results. Click the headline, read the causes in order, then read By endpoint. Open one cause, check its examples, then ask about it or correct its verdict.

Recap

  • To automate API testing with AI well, let rules sort first: grouping and verdicts use no AI and change nothing.
  • Verdicts say what each cause is, and environment problems come first.
  • Each cause shows its evidence, and a likely bug keeps its tests unchanged.
  • A person has the last word on a verdict.

Next, in lesson 9.11, part 2, you fix the causes a test change can fix. For the wider habit, read how to debug failed API tests in CI/CD or the help page on Run Triage.

Hands-on lab

Try it: With a trial edition, run a Test Run Pack that has some failures, click View results, click the headline, read the causes and the By endpoint table, open one cause, then ask about it or say what it really is.

Enter your email to open the lab steps. One unlock opens every lab in the learning center.

No spam. Protected by reCAPTCHA — Google Privacy & Terms.

Frequently asked questions

Can you automate API testing with AI without letting it change your tests?+

Yes. In Shift-Left API, Run Triage groups failures and gives verdicts with fixed rules that use no AI and change nothing. AI comes in only where the project allows it, and in the workflow shown here every proposed fix waits for a person.

How does API test failure analysis tell a product bug from a test problem?+

The rules read the status, headers and body of each answer, then give each cause a verdict: Environment, Likely product bug, Tests out of date, Test data or Needs a look. Treat a verdict as a reading of the evidence. You can open the cause, check the examples and correct it.

Is this kind of AI API testing included in every edition?+

Run Triage, and Fix with AI on a test, are in every edition. Test Run Packs, whose runs get the full report, come with Professional, the 15-day trial and Enterprise. The AI parts need an AI provider.

Read more on the blog