Skip to content
Swarmetry

Run and analyse tests

Preflight and debug evidence

Check a scenario with a few users before a large test, the run policy, screenshots of failures, the Messages and Page tabs, the comparison with the last passing run.

A scenario that works for one virtual user can break with two: a token that works only once, an account two users share, a row of test data used twice. A preflight finds this in a minute, before a large or costly test. When a step fails, Swarmetry also keeps what the page showed and what the protocols exchanged, and compares a debug run with the last one that passed.

Check first with a preflight

In the Start a run dialog, Check first with a preflight (recommended) is ticked by default. Check first runs each flow of the test configuration with 2 virtual users × 2 iterations on the built-in generator, with the options and the test data of the configuration and without its thresholds. A preflight is a real run: it sends real requests and counts as one run.

A passed preflight in the start dialog

The dialog shows the iterations run, then the result in plain language:

Finding What it means
Every planned iteration ran and every step passed The test can start.
A step failed in every iteration that reached it The step is broken for everyone: fix it first.
A step passed in the first iteration of each virtual user and failed in the next one A value that works only once (a token, a one-time code) or something the first iteration left behind (a cart, an order).
A step passed for one virtual user and failed for another Two virtual users share what they cannot share: an account, a row of test data. Give each one its own.
A step failed in some iterations without a pattern A warning: check the stability of the target.
A step threw an error The error code of the request is given.
The test data ran out of rows Give it more rows or let rows be reused.

After a pass, Start the test starts the run with the preflight as its evidence. After a failure, fix the scenario and check again, or Start anyway.

A failed preflight and "Start anyway"

The runs list and the run page mark preflights with a Preflight badge; the page of a preflight shows its result.

When your organization requires one

Organization administrators choose in Administration → Approvals, section Preflight before large tests:

  • Off: never offered; Suggested (default): offered before every test; Required above the threshold: a test with more virtual users than the threshold (default 100), or from countries when that box is ticked, needs a passed preflight.
  • A passed preflight stays valid 24 hours by default (1 to 720).
  • Members may start without a passed preflight by giving a reason (on by default): Start anyway then asks for a reason of 10 to 500 characters, kept with the run.

The run policy

A required preflight must have checked the same scenario version, test configuration and environment. Schedules are checked when they are saved: give the preflight (or a reason) then. Each scheduled run checks it again, without the age limit: it does not start when the scenario, the test configuration or the environment changed since, when the preflight did not pass, when the policy changed (a preflight now required, or reasons no longer allowed), or when the preflight saved with the schedule can no longer be read. The schedule's history says why; save the schedule again with a new preflight: on the Schedules page, Check and save again on the schedule's note does both (Running tests).

Screenshots of failures

When a browser step fails (an error, a failed assertion), Swarmetry takes a screenshot of the page. A debug run or a preflight keeps the first 5 failures; a load test keeps one screenshot for a few sampled iterations (the first three, then the 10th, the 100th, the 1 000th…), whatever its size. The run page lists them under Screenshots of failures, at most 20 per run, and they are deleted with the run's other data.

The debug panel

After Run the flow in the workflow editor:

  • a gRPC or WebSocket step has a Messages tab: the call (target, method, status, the names of the metadata sent) and the messages sent and received, or the frames of the session;
  • a browser step has a Page tab: the URL, and for a failed step (or the last browser step of the flow) the title, the errors and warnings of the console and the screenshot.

The Page tab of a failed browser step

Compare with the last passing run compares the debug run, step by step, with the last debug run of the same flow whose steps all passed. The steps that changed are listed and marked on the canvas: a different status, a check that now fails, a value the run no longer found (and the steps that use it), a new error, a step that did not run.

The comparison with the last passing run

Ask the assistant

The assistant can start a preflight (it asks you first: a preflight is a real run) and read its result. When a debug run fails, ask it, for example: “my debug run fails on the cart, fix it”: it reads the trace of the run, compares it with the last passing run and proposes the correction of the scenario, then tells you to run the debug run again. The trace holds what your system answered, so the correction waits for your Approve (see Assistant).