Scripting a load test: correlation, parameters and timers
Turn a plan into a script that works for every pretend user, and learn why a run with no errors can still be wrong.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: rehearsing a play where each actor has a different name and the ticket numbers change every night. If you copy last night's script word for word, the actors say the wrong names and read out old ticket numbers. The play runs, but it makes no sense.
Daily List is a to-do list app. Tom records one trip with a test tool: log in, then add a task. He plays it back with twenty pretend users. The tool reports no errors at all. Twenty replies came back with a good status.
But Tom looks inside the replies. Every one says "session expired". The recording had Lily's name and last night's ticket number in it. The pretend users all used the same name and an old ticket.
This is scripting: turning a plan into a script that works for every pretend user, and checking that it really works.
The picture has a limit. A play has one audience. A load test has many pretend users at the same time.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- rehearsing
- practising beforehand
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Making a recorded trip work for every pretend user, checking it worked, and writing the so a build can judge it.
- Change the names
- Catch the new ticket
- Check the reply
- Climb slowly
- Write the pass line
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Actors with different names | Users from a data file |
| Tonight's ticket number | The captured session token |
| The audience laughing at the right line | A check on the reply text |
| A slow walk onto the stage | Ramp-up |
| Stage-door rules: how many may fail, how late the curtain may rise | Thresholds in the script, on failed requests and on reply time such as p(95) |
| The stage manager who stops the show and rings the red bell | A non-zero exit code, which turns the build step red |
| Rules taken from the theatre's promise to its audience | Numbers taken from a service level objective (SLO), not from a guess |
| The theatre owner's signed letter before the rehearsal | Written permission before any load run, naming the test site, hours and biggest crowd |
WHERE THIS PICTURE STOPS
- A play has one audience. A load test has many pretend users at once.
- A play is rehearsed once. A script is run again and again.
- Actors know their lines. A tool only follows the script.
- A stage manager can use judgement. A threshold only follows the rule written in the script.
HOOK
New names, new tickets, check the words, pin the pass line.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Give each user a name from a file, capture the session token, check the reply text, and pin the .
| In the trick | What it stands for |
|---|---|
| Actors with different names | Users from a data file |
| Tonight's ticket number | The captured session token |
| Audience laughing at the right line | A check on the reply text |
TELL A FRIEND
In a rehearsal where actors change names and the ticket changes each night, use the right names, catch the new ticket and check the reply. Then write the into the script as thresholds from the service level objective, and get before you run it.
OFTEN MIXED UP WITH Performance test design. The design lesson plans the load. This lesson turns the plan into a script that runs.
PRACTISE AND KEEP
Sources for this topic — 12 sources
- Market practice
Component Reference (Apache JMeter user manual) ↗ — Apache Software Foundation · Thread Group ramp-up period, Constant Timer and post-processors such as extractors (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. V27 supplement, 6 November 2026: relevant primary page sections actually opened; implementation-specific current product guidance, not universal standard. See full V27 audit for version and access scope.
- Market practice
ISTQB Certified Tester Performance Testing Syllabus v1.0 (2018) ↗ — International Software Testing Qualifications Board (ISTQB) · Mirror copy of the publisher PDF (ISTQB syllabus CT-PT Version 2018, 9 December 2018, ISTQB GA release), version checked against the document's own front matter, read in full text: the syllabus is titled Foundation Level Specialist Syllabus, Performance Testing. It has five chapters: basic concepts, performance measurement fundamentals, performance testing in the software lifecycle, performance testing tasks and tools
Text read in full from a mirror copy of the publisher PDF (ISTQB syllabus CT-PT Version 2018, 9 December 2018), version checked against the document's own front matter. The page at this URL was not opened. Licence terms were not read, so put it in your own words and do not quote it.
Specialist review 6 November 2026: Actual CT-PT2018 front matter and selected workload, design, execution, analysis and tool sections read; exact sections and gaps in Specialist source ledger. Professional certification guidance, not binding legislation or a formal ISO standard. Inherited full-text descriptions are not a claim that this audit read every PDF page.
- Market practice
Test types (Grafana k6 documentation) ↗ — Grafana Labs · Load test types and ramping stages in a script (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Thresholds (Grafana k6 documentation) ↗ — Grafana Labs · A threshold is a pass or fail rule set in the options of a script, such as a rate for failed requests and a 95th percentile for request duration; if a rule is false at the end, the whole test fails and k6 exits with a non-zero code (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read as a search excerpt only. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Defining success: service level indicators, objectives and performance budgets (Amazon Web Services performance testing guide) ↗ — Amazon Web Services · Load tests should check service level objectives, which are tighter than agreements (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Exit status (GNU Coreutils manual) ↗ — GNU Project · Most commands exit with zero for success and a nonzero value for failure (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Load testing policy (Auth0 documentation) ↗ — Auth0 · One provider's policy: written approval is needed before any load test and testing is limited to off-peak windows; shows load tests need permission (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read as a search excerpt only. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Checks (Grafana k6 documentation) ↗ — Grafana Labs · Grafana k6 docs: checks do not affect the exit status; combine with a threshold on the checks metric; abortOnFail is a threshold option. Search excerpts, pages not opened; the checks-rate example was an inference from the excerpt, so confirm on the page before release.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Checks vs thresholds (Grafana k6 learning hub) ↗ — Grafana Labs · Grafana k6 docs: checks do not affect the exit status; combine with a threshold on the checks metric; abortOnFail is a threshold option. Search excerpts, pages not opened; the checks-rate example was an inference from the excerpt, so confirm on the page before release.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Correlate a login session in JMeter ↗ — Simplified Guide · Guide suggests a visible default value so extractor misses are easy to spot. Search excerpt, page not opened.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Using k6 browser (Grafana k6 documentation) ↗ — Grafana Labs · Says the k6 browser module drives a real Chromium-based browser, reports browser metrics such as Web Vitals, and keeps them apart from the plain HTTP metrics.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Test lifecycle ↗ — Grafana k6 · k6 runs init code, setup once, VU code repeatedly and teardown once; SharedArray is built in the init context (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.