Skip to content

Test dependencies

A test script rarely runs alone. It needs an API key, a backend that is not built yet, an app that runs on your laptop, or real browsers. Test dependencies let you declare those needs on the test’s Dependencies tab. Every run then starts with a preparing dependencies phase that brings up what is stopped, injects the addresses as environment variables, fails with a named reason when something cannot come up, and releases what it started when the run ends.

Test dependencies overview.
KindWhat the script getsRun lease
SecretAn encrypted workspace valueNo. Injected, never leased.
Virtual serviceThe URL of a mocked backendYes. Started if stopped.
TunnelA public URL for an app on your machineYes. Never stopped by a run.
Browser fleetEndpoints and a token for managed real browsersYes. Started, then stopped after the run.
DataA CSV or generated dataset, one row per virtual userNo. A read-only summary row.

The variables a script reads, one per line:

SECRET_<NAME>
MAXOPERF_VS_<STEM>_URL
MAXOPERF_TUNNEL_<STEM>_URL
MAXOPERF_FLEET_<STEM>_WEBDRIVER_URL
MAXOPERF_FLEET_<STEM>_PLAYWRIGHT_URL
MAXOPERF_FLEET_<STEM>_CDP_URL
MAXOPERF_FLEET_<STEM>_TOKEN

A dataset has no variable. It is bound per virtual user and read from the Data tab.

<STEM> is the name you choose when you bind the dependency: upper-case letters, digits and underscores, starting with a letter, at most 40 characters. A virtual service bound as PAYMENTS is injected as MAXOPERF_VS_PAYMENTS_URL. The binding dialog shows the exact name before you save.

A lease is the run’s claim on a dependency. Only virtual services, tunnels and browser fleets get one, because only those have a state the run has to wait for. A secret has nothing to wait for. A dataset is delivered by the Data tab, not by the preparing phase.

  1. Create the dependency once, in its own product: a secret in the vault, a virtual service, a tunnel, a browser fleet or a dataset.
  2. Open the test, go to Dependencies, click Add dependency, pick the kind and the entity, and choose a stem. Datasets are bound on the Data tab and appear here as a read-only row.
  3. Read the injected variable in the script, or pick the dependency as a chip in a builder field.
  4. Start the run. MaxoPerf prepares every lease, then starts the runners with the variables set.
  5. When the run ends, MaxoPerf releases the leases and stops only what the run started.
The Dependencies tab with all five bindings in place. Each row lists the variables the script reads.

Run-time behavior covers steps 4 and 5 in detail. The worked example wires one checkout test to all five kinds.

Your test needsBindLeave it out when
A credential the script must not containA secretThe value is public and the same for everyone.
A third-party or unfinished API that is slow, costly or absentA virtual serviceThe real service is cheap, stable and safe to hit under load.
An app on your laptop or a private networkA tunnelThe app already has a public URL.
Real Chrome, Firefox or Edge for a scriptA browser fleetThe test is an API test, or MaxoPerf’s own browser tests are enough.
Different input for each virtual userA datasetEvery virtual user sends the same request.

A dataset is the fifth kind, but it is bound on the test’s Data tab, per virtual user, and is not a lease. The Dependencies tab lists it as a read-only row that links back to the Data tab. See Test data for splitting rows across runners.

An EUX probe is a browser test that runs next to a load test to measure real browser experience under load. A run with a probe is a composite run. The test’s own dependencies and the master test’s dependencies reach every member run, and the run’s Dependencies tab shows which member needed which lease. Run-time behavior explains which value wins when both define the same name.