Creating Your First Test Plan in JMeter

Creating Your First Test Plan in JMeter

A friendly, step-by-step guide from an empty window to a working load test: what to install, what to click, what each setting means, and how to read your first results with confidence.

Imagine you have just opened a small bakery. On the first morning, ten customers walk in, and everything is fine. But you wonder: what happens on a busy Saturday, when two hundred people arrive at once? Do you run out of bread? Does the queue reach the street? Does the till break? You could wait for Saturday and find out the hard way, or you could invite two hundred friends on a quiet Tuesday and watch carefully. The second plan is a load test.

Apache JMeter is a free tool that invites those friends for you. It pretends to be many people using your website, application, or service at the same time, and it measures how the system copes. Everything JMeter does is described in a document called a test plan. If you can create one test plan, you can create a hundred, because every test plan is built from the same few kinds of building blocks.

This guide teaches you to create your first test plan from zero. You will install the tool, learn the screen, add each building block one at a time, run a gentle first test, and read the results. Then we go further into what makes a plan trustworthy: how JMeter works internally, how to scale up safely, how to run without the window, how to keep plans tidy, and which beginner mistakes to avoid. Every new term is explained the first time it appears, and every big idea comes with an everyday comparison.

WWhat Is a Test Plan?

A test plan is the written recipe that tells JMeter what to do.

A test plan is the complete description of a load test. It says how many virtual users to create, which requests they should send, how long they should pause, what answers to expect, and where to show the results. In JMeter, a test plan is a tree of small building blocks called elements. You build the tree in a graphical window, then press a button to run it.

What a plan contains

Who

Thread Group

Describes the crowd: how many virtual users, how fast they arrive, and how many times they repeat.

What

Samplers

The actual requests the users send, such as opening a web page or calling a service.

How

Config Elements and Timers

Shared settings and pauses that make the users behave more like real people.

Right

Assertions

Checks that the answers are correct, not merely fast.

Result

Listeners

Windows that show or save what happened during the test.

Everyday analogy

Think of a film script. It lists the actors, what each one does, in what order, and what the camera records. The script is not the film. It is the plan that lets the film be made again and again. A test plan is the script of a load test.

1
plan is one file you can save and share
5
kinds of building blocks to learn first
0
lines of code needed for a first test
i
Good to know

A virtual user is one simulated person. JMeter runs each virtual user in its own thread, which is a separate line of work inside the program. That is why the user group is called a Thread Group.

WWhat You Need Before You Start

Three things: Java, JMeter, and a system you are allowed to test.

JMeter is itself a program written in the Java language, so the computer must have a supported version of Java installed. The JMeter download page states which Java versions your release needs, so check it when you download. JMeter needs no installer. You download a compressed folder, unpack it, and run it from where it sits.

Your starter checklist

1

A computer with Java

Check that Java is installed and that its version suits your JMeter release. Install a suitable one if it is missing.

2

The JMeter download

Get the binary package from the official Apache JMeter site and unpack it into a folder you can find again.

3

A safe target

Choose a website or service you own, or have written permission to test. A test environment or a practice site is ideal.

4

A small goal

Write down one simple user journey you want to measure, such as opening the home page and searching for a product.

Everyday analogy

Before you bake, you check that you have an oven, the ingredients, and permission to use the kitchen. Java is the oven, JMeter is the recipe book, and the target system is the kitchen you have been invited to use.

!
Watch out

Never aim a load test at a system you do not own or have permission to test. Heavy traffic can look like an attack, can slow real users, and can have legal consequences. When in doubt, ask the owner first.

PPlanning Before You Click

Five minutes of thinking saves an hour of confusion.

Beginners often open JMeter and start adding elements at random. A better habit is to write a tiny plan on paper first. It does not need to be fancy. It only needs to answer four questions.

QuestionWhy it mattersExample answer
What journey do real users take?The test should copy real behaviourOpen the home page, search, open one product
How many users, and how fast?It sets the size and shape of the loadFive users, arriving over ten seconds
How long do users pause?Real users read before they clickTwo to four seconds between steps
What counts as success?A fast wrong answer is still wrongEach page shows its expected heading, and no errors
Everyday analogy

A traveller sketches a route before driving, even for a short trip. The sketch is not the journey, but it stops you from circling the same roundabout. Your paper plan is the sketch of the test.

Start small on purpose

Your first plan should be tiny: one thread group, two or three requests, a couple of checks, and one or two result windows. A small plan is easy to understand and easy to fix. You can always add more later, but a large, confusing plan is hard to untangle.

i
Production note

Professional teams plan around business goals, such as “support two thousand shoppers during a sale”. Even then, they build and prove a tiny plan first, and grow it step by step.

IInstalling and Starting JMeter

Unpack, open the bin folder, and run the starter file.

After you unpack the JMeter download, you will see a folder with a name that includes the version number. Inside it is a folder called bin, short for binaries, where the programs live. To start the graphical window, run the starter file for your system from that folder: a batch file on Windows, and a shell script on Linux and macOS. The window opens after a few seconds.

1

Unpack the download

Extract the archive into a folder with a short, simple path and no unusual characters.

2

Open the bin folder

Find the starter files and the main property file, which we meet in later guides.

3

Run the starter file

Use the one made for your operating system. A black console window may also appear. Leave it open, because it shows messages.

4

Wait for the window

The first start can be slow. When the main window shows an empty tree with a single item, you are ready.

Everyday analogy

Starting JMeter is like unlocking a workshop and switching on the lights. Nothing has been built yet, but the tools are laid out and ready on the benches.

If it does not start

  • Check that Java is installed and reachable from the command line.
  • Check that the folder path does not contain odd characters or very long names.
  • Read the messages in the console window. They usually name the problem in plain words.
  • Make sure you downloaded the binary package, not the source package.
i
Tip

The window may print a message advising you not to run big load tests in the graphical mode. That advice is correct, and we explain why in a later chapter. The window is for building and debugging.

AA Tour of the JMeter Window

Four areas cover almost everything you will do.

AreaWhereWhat it is for
Menu barTopOpen, save, and start from templates, plus options and help
ToolbarUnder the menu barQuick buttons: open, save, start, stop, clear, and search
TreeLeft sideThe test plan as a branching list of elements
Work areaRight sideThe settings of whichever element is selected in the tree

The buttons you will use most

Run

The green Start arrow

Runs the whole plan. If a plan has problems, JMeter may warn you before it starts.

Stop

Stop and Shutdown

Stop ends the threads immediately. Shutdown lets running requests finish first, which is gentler.

Clean

The broom buttons

Clear results of one element or of all elements, so old results do not mix with new ones.

Counter

The top-right numbers

Show how many threads are active, and a small indicator when a test is running.

Everyday analogy

The window is like a car dashboard. The tree is the route map, the work area is the settings panel, and the toolbar is the pedals. You will learn which is which within minutes of driving.

i
Version note

The layout and the wording of labels differ slightly between JMeter versions. The ideas in this guide stay the same, but always compare with the screen in front of you.

TThe Tree: Elements, Parents, and Scope

Where you place an element decides which requests it affects.

The tree starts with a single item, the Test Plan. Everything else hangs beneath it. You add an element by right-clicking an existing one and choosing Add. The element you right-click becomes the parent of the new element, and the parent decides its scope, which is the set of requests the new element applies to.

flowchart TD
    TP["Test Plan"] --> CE["Config Element at plan level: applies to everything"]
    TP --> TG["Thread Group: the crowd of users"]
    TG --> S1["Sampler: Home Page"]
    TG --> S2["Sampler: Search"]
    S2 --> A1["Assertion: applies only to Search"]
    TG --> T1["Timer: applies to every sampler in the group"]
    TG --> L1["Listener: collects results from every sampler in the group"]
FIG 1 · The position of an element in the tree sets its scope.
Everyday analogy

A rule on the school gate applies to every pupil, a rule on a classroom door applies to that class, and a note on a single desk applies to one child. The wider the posting, the wider the effect.

Rules of thumb for scope

  • Put shared settings high in the tree, so they apply to everything beneath.
  • Put checks next to the one request they belong to.
  • Put result windows where they can see the requests you care about.
  • Avoid placing heavy elements at a wide scope without a reason.
i
Tip

You can drag elements to move them within the tree, and copy and paste branches. If an element has the wrong parent, move it instead of deleting and rebuilding it.

NNaming and Saving Your Plan Early

Give the plan a name, and save it before you build anything else.

Click the Test Plan item at the top of the tree. In the work area, you will see a Name field. Replace the default name with something meaningful, such as the purpose and the system, for example “Shop first test”. Then save the plan with the Save button or the File menu. JMeter saves plans in files with the extension jmx, which stands for JMeter extensible markup. These files are text, so teams can keep them in version control.

Good habits from the first minute

  • Save before you run. A crash during a test can lose unsaved work.
  • Save often. A few seconds of saving beats a lost hour.
  • Use clear file names. Include the system, the purpose, and a version or date.
  • Keep plans in their own folder. Put data files and notes beside them.
Everyday analogy

A writer who saves the document after every paragraph never loses a chapter. The plan is the document, and saving is the habit that protects your work.

!
Watch out

Do not keep your only copy of a plan inside the JMeter installation folder. An upgrade or a cleanup could remove it. Keep plans in a project folder of their own.

SStep One: Add a Thread Group

The Thread Group is the crowd. Without one, nothing runs.

Right-click the Test Plan, choose Add, then Threads (Users), then Thread Group. A new item appears in the tree, and its settings show in the work area. A Thread Group controls how many virtual users run, how quickly they start, and how many times each one repeats the journey.

The settings that matter first

SettingWhat it meansA safe first value
Number of Threads (users)How many virtual users run at the same timeOne, for the very first run
Ramp-up period (seconds)How long JMeter takes to start all the usersOne second, or the same as the user count
Loop CountHow many times each user repeats the whole journeyOne, until you trust the plan
Action after a sampler errorWhat each user does when a request failsContinue, so you can see all the errors
Everyday analogy

The Thread Group is a ticket gate at a funfair. It decides how many visitors enter, how quickly they are let in, and how many times each may ride. The rides themselves are the requests.

i
Tip

Rename the Thread Group to describe the kind of user, such as “Shoppers”. When a plan has several groups, descriptive names make the tree readable.

UUnderstanding Users, Ramp-Up, and Loops

Three numbers shape the whole load, and they depend on each other.

The number of users says how many virtual users exist. The ramp-up period says how long JMeter takes to start all of them. If you ask for twenty users with a ramp-up of twenty seconds, JMeter starts about one new user each second. The loop count says how many times each user repeats the journey. Tick the Infinite option to keep users repeating until you stop the test or a time limit ends it.

A small example with numbers

Five users, a ramp-up of ten seconds, and three loops. A new user starts every two seconds. Each user performs the journey three times. In total the server receives fifteen journeys. If each journey has three requests, that is forty-five requests.

UsersRamp-upLoopsJourneys in totalNew user every
11 second11Immediately
510 seconds3152 seconds
2020 seconds51001 second
10050 seconds101,000Every half second
Everyday analogy

Opening a stadium: the number of users is how many tickets were sold, the ramp-up is how slowly the gates open, and the loop count is how many matches each ticket holder attends.

!
Watch out

A very short ramp-up with many users is a sudden crush at the door. It tests how the system handles a shock, not how it handles steady traffic. Choose a ramp-up that matches the situation you want to study.

CChoosing Sensible Starting Numbers

Begin tiny, prove the plan, then grow in steps.

The temptation for beginners is to start with hundreds of users, to see something dramatic. That is almost always a mistake. A plan with a hidden error will produce hundreds of errors, and the result tells you nothing. A better approach is a sequence of small runs, each proving something before the next.

1

One user, one loop

The proof run. Does every request work, and does every response look right?

2

Five users, a few loops

The sanity run. Do the requests still work when several users run together?

3

Twenty users, a longer run

The first real measurement. Do the response times look steady?

4

Step up gradually

Raise the user count in careful steps, and watch where response times begin to climb.

Everyday analogy

When you test a new bridge, you do not drive a convoy of heavy trucks across it on the first day. You walk across, then a car, then a van, and watch how it responds at each step.

i
Production note

Always begin with the smallest meaningful run, and stop immediately if the target shows distress. A load test that damages the system under test has failed, whatever the numbers say.

SStep Two: Add HTTP Request Defaults

Say the server name once, and let every request borrow it.

Most web tests send many requests to the same server. Typing the server name into every request is tedious, and a mistake in one place creates a very confusing test. The HTTP Request Defaults element solves this. It holds the shared settings, such as the protocol, the server name, and the port number, and every HTTP request beneath it uses them unless the request says otherwise.

How to add it

1

Right-click the Thread Group

Choose Add, then Config Element, then HTTP Request Defaults.

2

Fill in the protocol

Type http or https, matching the system you are testing.

3

Fill in the server name

Type the name only, such as the web address without the protocol and without any path.

4

Leave the rest empty

An empty field means the request will supply it, or the usual default is used.

Everyday analogy

Think of the sender’s address printed on a pad of envelopes. You write each letter’s destination separately, but the sender’s address is already printed. The defaults element is the printed address.

i
Tip

Because the server name lives in one place, switching to a different environment later means changing one field, not twenty. Later guides show how to supply it from outside the plan.

SStep Three: Add Your First HTTP Request

A sampler is where a virtual user actually does something.

A sampler is an element that sends a request to a server and waits for the answer. The most common sampler is the HTTP Request, which does what a web browser does when you type an address or click a link. Right-click the Thread Group, choose Add, then Sampler, then HTTP Request.

Fill in the essentials

  • Name: a clear label such as “Open Home Page”. The name appears in the results, so make it readable.
  • Method: the kind of request. GET asks for something, and POST sends something, such as a filled-in form.
  • Path: the part of the address after the server name, such as a slash for the home page.
  • Server and protocol: leave these empty, because the defaults element supplies them.
Everyday analogy

A sampler is a single customer at a shop counter. They say what they want, wait for the answer, and walk away. JMeter simply makes thousands of customers do this at once and times each visit.

i
Tip

Use a short, descriptive name that you could read aloud in a meeting, such as “Search for product”. Names like “HTTP Request 7” tell nobody anything when the report arrives.

i
Production note

The sampler name becomes the label in every report. Consistent naming across plans makes comparing results over time much easier.

FThe Fields of the HTTP Request, Explained

A short tour of the screen, so no field is a mystery.

Field or tabWhat it doesWhen to touch it
Name and CommentsLabel and notes for peopleAlways give a good name
Protocol, Server, PortWhere to send the requestLeave empty if defaults supply them
MethodGET, POST, and other kinds of requestMatch what the real browser does
PathThe location on the serverAlways set for each request
Parameters tabName and value pairs sent with the request, such as search wordsWhen the page needs input
Body Data tabA block of text sent as the body, often for data servicesWhen the service expects a body
Follow RedirectsLets JMeter follow forwarding from the serverUsually on, as browsers do
Use KeepAliveReuses connections like a browserUsually on
Advanced tab: embedded resourcesFetches images, styles, and scripts found in the pageWhen you want a full page load
Advanced tab: timeoutsHow long to wait to connect and to receive a responseTo avoid waiting forever
Everyday analogy

A postal form has boxes for the address, the parcel type, and special handling. You only fill in the boxes your parcel needs. The HTTP Request screen works the same way.

A word about embedded resources

A real web page is made of many parts: the page itself, plus images, style files, and scripts. By default, a JMeter request fetches only the page. If you want to measure a full page load, you can ask JMeter to fetch the embedded parts too. This produces more requests and more load, so use it deliberately, and decide whether it matches what you want to test.

!
Watch out

Turning on embedded resources on every request can make results hard to compare with earlier runs and can add a great deal of load. Change it on purpose, not by accident.

SStep Four: Cookie Manager and Header Manager

Make your virtual users behave like real browsers.

Real browsers do two quiet things on every request. They remember cookies, and they send headers. If your virtual users do neither, the server may treat each request as coming from a stranger, and the test will behave in unrealistic ways.

HTTP Cookie Manager

A cookie is a small piece of data a server gives to a browser, such as a session identifier, which the browser sends back on later requests. The HTTP Cookie Manager stores cookies for each virtual user and sends them back automatically. Add it under the Thread Group, with Add, Config Element, HTTP Cookie Manager. Each virtual user has its own separate set of cookies.

HTTP Header Manager

A header is a short label sent with a request, such as the kind of browser, the languages accepted, or the type of content being sent. The HTTP Header Manager lets you add headers that every request in scope will carry. Common examples describe the browser identity and the content type.

Cookies

Remember the visitor

Keeps session identifiers so a user stays signed in from one request to the next.

Headers

Describe the request

Tell the server what kind of client is calling and what kind of answer is acceptable.

Everyday analogy

A visitor to an office is given a badge at reception and shows it at every door. The cookie is the badge. Headers are the polite introductions each person gives at each door.

i
Tip

Add a Cookie Manager to almost every web plan. Without it, any page that needs a session will behave strangely, and you may spend an hour wondering why.

SStep Five: Build a Small Journey

Two or three requests in the right order are enough to mimic a visit.

A single request tests a single page. A journey is a short sequence of requests that matches what a real person does. Add more HTTP Request samplers under the Thread Group, in the order a visitor would use them. Each virtual user runs them from top to bottom, then repeats if the loop count says so.

StepRequest nameMethodPurpose
1Open Home PageGETThe first page every visitor sees
2Search for ProductGETA search with a word to look for
3View Product PageGETThe page of one chosen item
Everyday analogy

A tour guide leads a group through a museum in a fixed order: entrance, main hall, gift shop. The order matters because people do not skip straight to the gift shop. A journey in JMeter follows the same route.

Why order and realism matter

  • Later pages often depend on earlier ones, such as a product link found on a search page.
  • Real traffic is a mixture of steps, so a test of one page alone says little about the whole system.
  • A realistic journey exercises caches, databases, and sessions together, just as real traffic does.
i
Production note

Real journeys often need values from earlier responses, such as tokens or identifiers. This is called correlation, and later guides explain how extractors capture those values. For a first plan, choose steps that work without them.

SStep Six: Add Think Time with a Timer

Real people pause. Timers give your virtual users that pause.

Without any pause, a virtual user fires its next request the instant the last one finishes. A few users doing that produce a load far heavier than a few real people would. A timer adds a delay before each request, called think time, which is the time a real person spends reading and deciding.

Timers you will meet first

TimerWhat it doesWhen to use it
Constant TimerWaits for the same number of milliseconds each timeSimple and predictable first tests
Uniform Random TimerWaits for a random time within a rangeMore natural variation between users
Gaussian Random TimerWaits for a time that clusters around a typical valueWhen most people pause about the same, with some spread
Everyday analogy

Customers in a shop do not rush from shelf to shelf with no pause. They read labels, compare prices, and think. Think time is that natural hesitation.

A note on scope and units

Time values in timers are in milliseconds, where one thousand milliseconds make one second. A timer placed under a thread group applies to every sampler in the group. A timer placed under one sampler applies only to that sampler. Remember that a timer delays its sampler before it runs, so the first request also waits.

!
Watch out

Typing seconds where milliseconds are expected is a very common slip. A pause of “three” is three thousandths of a second. Write three thousand for three seconds.

SStep Seven: Add an Assertion

A fast answer is only good if it is the right answer.

By default, JMeter treats a response as successful when the server answers with a normal status code. But many systems show an error page and still use a normal code. A test that only looks at codes would report success for pages that are broken. An assertion is a check that looks inside the response and marks the request as failed when something is wrong.

Your first assertion

1

Right-click a sampler

Choose Add, then Assertions, then Response Assertion.

2

Choose what to test

Select the text of the response as the field to test.

3

Choose the rule

Pick Contains for a simple check that the text includes a piece of wording.

4

Add a pattern

Type a short piece of text that only a correct page would contain, such as a heading of that page.

Everyday analogy

When you order a pizza, you open the box to check that it is the pizza you ordered. A quick delivery with a salad inside is still a failed order. An assertion is the habit of opening the box.

i
Tip

Choose a marker text that is specific to the page, not a word that also appears on error pages. The site name alone is a poor choice, because an error page usually shows it too.

SStep Eight: View Results Tree

The debugging window that shows every request and response.

A listener collects results and shows them. The View Results Tree listener lists every request the test sent. For each one you can open the request that was sent, the response that came back, and any assertion results. It is the best tool for answering the question “did my plan actually do what I thought?”.

Tab

Sampler result

Summary details: time taken, status code, size, and whether the sample passed.

Tab

Request

The exact request that was sent, which is useful for checking that parameters arrived.

Tab

Response data

The body that came back, which you can view as text or as a rendered page.

Colour

Green and red marks

A green mark means the sample passed. A red mark means it failed, with a reason on the result tab.

Everyday analogy

A security camera recording lets you replay exactly what happened at each door. The results tree is the replay: every visit, with a closer look available on request.

!
Watch out

This listener keeps full responses in memory, so it is expensive. Use it for debugging with a few users, and disable it before any bigger run.

SStep Nine: Summary Report

A compact table of the numbers you care about.

The Summary Report listener shows one row for each request name, plus a total row. It is light and quick to read, which makes it a good companion for the results tree. Add it under the Thread Group with Add, Listener, Summary Report.

ColumnPlain meaning
# SamplesHow many requests of this kind were sent
AverageThe mean response time, in milliseconds
Min and MaxThe fastest and slowest response times
Std. Dev.How scattered the response times are around the average
Error %The share of requests that failed
ThroughputHow many requests were handled per unit of time
Received and Sent KB/secThe data rate in each direction
Avg. BytesThe average size of a response
Everyday analogy

A school report card shows one line per subject plus an overall result. The Summary Report is the report card of your test.

i
Tip

Always read Error % before reading any speed figure. A very fast average with a high error rate means the system is failing quickly, not performing well.

RRunning Your First Smoke Test

One user, one loop, and a close look at everything.

A smoke test is a small, quick run whose only purpose is to check that everything works before anything bigger happens. The name comes from the old habit of switching on new electrical equipment and watching for smoke. Set the Thread Group to one user, a ramp-up of one second, and one loop, then follow these steps.

1

Save the plan

Press Save, so nothing is lost if something goes wrong.

2

Clear old results

Use the clear-all button so listeners start empty.

3

Press Start

Click the green arrow. The thread counter at the top right shows activity.

4

Open the results tree

Check each request has a green mark, and open the response tab to see whether the page looks right.

5

Check the Summary Report

Confirm the sample counts match your expectation and that Error % is zero.

6

Fix and repeat

If anything looks wrong, fix it and run again. Do not scale up until the smoke test is clean.

Everyday analogy

Before a long drive, you start the car and listen to the engine in the driveway. If it coughs there, it will cough on the motorway. The smoke test is that moment in the driveway.

i
Production note

Professional teams run a smoke test before every major run, and often as an automatic first step in a pipeline. It costs seconds and saves hours.

RReading Your First Results

A handful of numbers tell the main story.

When the run ends, look at the Summary Report with a calm routine. You do not need to understand every column on day one. A few readings are enough to decide whether the next step is safe.

Three questions to ask

  • Did anything fail? Check Error %. Anything above zero in a first run deserves a look in the results tree.
  • How long did requests take? Look at the average and the maximum. A large gap between them suggests a few slow requests.
  • Do the counts add up? The number of samples should equal users times loops times the number of requests in the journey.
What you seeLikely meaningWhat to do
Error % is zero and times are steadyThe plan worksTry a slightly larger run
Error % is above zeroSome requests or assertions failedOpen the failures in the results tree
Average is low but maximum is highA few slow outliersRepeat the run and see whether it recurs
Sample count is lower than expectedThe plan stopped early or a request was skippedCheck the thread group settings and the log
All times near zeroRequests may be failing instantlyCheck status codes and assertions
Everyday analogy

When a doctor reads a blood test, she does not study every figure at once. She checks the few that matter most and follows up on anything unusual. You can do the same with your first results.

i
Tip

Write the key numbers in a short note beside the plan, with the date and the settings you used. Your own history of runs becomes your most useful reference.

WWhen a Request Fails: First Aid for Beginners

Most first-time failures have simple causes.

SymptomLikely causeWhat to check
Connection refused or cannot reach hostWrong server name, port, or protocol, or the server is downThe defaults element, and try the address in a browser
Everything fails with a secure connection errorProtocol mismatch or a certificate problemWhether to use http or https, and the server’s certificate
Response is a login pageNo cookie manager, or the session was not keptAdd or check the Cookie Manager
A page works in the browser but returns an error in JMeterMissing headers or parametersCompare the request with the browser’s request
Assertion fails on a page that looks rightThe marker text differs, or the wording is hidden in markupThe real response text in the results tree
Times are suspiciously close to zeroRequests fail instantlyStatus codes and the response body
The window freezes or runs slowlyToo many results held by listenersClear results, reduce load, or disable heavy listeners
Everyday analogy

When a torch will not light, you check the batteries before buying a new torch. Most test failures are as simple as flat batteries: a wrong address, a missing badge, or a switch left off.

i
Production note

When in doubt, repeat the request in a normal browser and compare. If the browser works and JMeter does not, the difference between the two requests is almost always the answer.

VVariables and User Defined Variables

Give a value a name once, and use the name everywhere.

A variable in JMeter is a named value. You write it inside a dollar sign and curly brackets, and JMeter replaces it with the current value when a request is sent. The simplest way to create variables is the User Defined Variables element, a small table of names and values. Add it with Add, Config Element, User Defined Variables.

What a first plan might define

Variable nameExample valueUsed in
Search wordA common product wordThe search request’s parameter
Product pathThe path of one product pageThe product request’s path
Think timeThree thousandThe timer’s delay in milliseconds
Everyday analogy

A recipe that says “add the sugar amount from the top of the page” lets you change one number and rescale the whole dish. Variables are the amounts written at the top of your plan.

Why this habit pays off

  • A value used in several places is changed in one place.
  • The settings of the plan are visible together, and a reviewer sees them at a glance.
  • Later, values can be supplied from outside, so one plan serves many environments.
i
Tip

Use clear names, such as the purpose of the value, and keep them consistent between plans. A name like “x” will puzzle you in a month.

DTest Data: Giving Each User Something Different

If every virtual user sends identical requests, the test is too easy.

Real users search for different words, sign in with different accounts, and open different products. If all your virtual users do exactly the same thing, the server may answer from a cache, and the test will flatter the system. The usual fix is a file of test data, read by the CSV Data Set Config element.

How it works in plain words

1

Prepare a file

Create a plain text file with one row per set of values, separated by commas, such as search words or user names.

2

Add the element

Add Config Element, CSV Data Set Config under the Thread Group and point it to the file.

3

Name the columns

Give each column a variable name, in the order they appear in the file.

4

Use the variables

Refer to the names inside requests. Each user takes the next row each time.

Everyday analogy

Imagine handing each guest at a party a different name badge from a stack. The badge stack is the data file, and every guest who arrives takes the next one.

!
Watch out

Use test accounts and made-up data, never real customer details. When the file runs out of rows, JMeter’s behaviour depends on its settings: it may stop the thread or start again from the top. Choose deliberately.

CControllers: Grouping and Choosing Steps

Controllers decide in what order, how often, and whether requests run.

Samplers do the work, and controllers organise it. A plan with only samplers runs them from top to bottom. Controllers let you group steps, repeat them, or run them only under certain conditions. You do not need them for a first plan, but it helps to know the main ones.

Group

Simple Controller

Holds a set of steps together for neatness. It does not change the order of execution.

Measure

Transaction Controller

Groups several requests and reports their combined time as one business step, such as “Checkout”.

Repeat

Loop Controller

Repeats its steps a chosen number of times within a single pass of the user.

Decide

If Controller

Runs its steps only when a condition is true, such as a variable holding a certain value.

Mix

Random and Throughput controllers

Choose among steps by chance, or run a step for only a share of the users, to model different behaviours.

Everyday analogy

A conductor does not play any instrument, but decides who plays, when, and how many times. Controllers are the conductors of a plan.

i
Tip

A Transaction Controller is the most useful early controller, because business people care about “how long did checkout take?” more than about the time of each small request inside it.

OThe Order of Execution

JMeter runs element types in a fixed order, not simply top to bottom.

For each sampler, JMeter follows a fixed order by element type. According to the JMeter documentation, the order is: Configuration Elements, Pre-Processors, Timers, the Sampler itself, Post-Processors, Assertions, and finally Listeners. Elements are only processed if there is a sampler they apply to.

flowchart LR
    A["Config Elements: defaults, cookies, data"] --> B["Pre-Processors: last-minute preparation"]
    B --> C["Timers: think time"]
    C --> D["Sampler: send request, wait for response"]
    D --> E["Post-Processors: capture values"]
    E --> F["Assertions: check the answer"]
    F --> G["Listeners: show or save results"]
FIG 2 · The order JMeter follows around every sampler.
StagePlain meaningExample
Config ElementsShared settings and dataHTTP Request Defaults, Cookie Manager
Pre-ProcessorsPrepare this requestA script that builds a value
TimersWait before sendingConstant Timer
SamplerSend and receiveHTTP Request
Post-ProcessorsStudy the answerExtractors that capture a token
AssertionsCheck the answerResponse Assertion
ListenersShow the resultSummary Report
Everyday analogy

When posting a parcel, you gather materials, wrap it, wait in the queue, hand it over, check the receipt, and file the record. The order of the steps is fixed by the job, not by where you happened to put the tape on the table.

i
Production note

Because order depends on type and not on position, a timer written below a sampler still runs before it. Beginners who expect top-to-bottom order are often surprised by this.

HHow JMeter Works Internally

Each virtual user is a thread that walks through the plan on its own.

When you press Start, JMeter reads the plan, creates the threads described by the Thread Group, and starts them according to the ramp-up. Each thread then works through the plan independently, sending requests, waiting for answers, and reporting results. Many threads run at the same time, which is what creates load.

sequenceDiagram
    participant U as Tester
    participant E as JMeter Engine
    participant T as Virtual User Thread
    participant S as Server Under Test
    participant L as Listeners
    U->>E: Press Start
    E->>T: Create threads following the ramp-up
    T->>T: Apply defaults, cookies, and timers
    T->>S: Send request
    S-->>T: Send response
    T->>T: Run extractors and assertions
    T->>L: Report the result
    L-->>U: Show tables and trees
    T->>T: Repeat for each loop
FIG 3 · The life of one virtual user inside a running test.
1

The plan is loaded

JMeter reads the plan and copies it for each thread, so users do not interfere with each other.

2

Threads start gradually

The ramp-up spreads the starts, so the load climbs instead of jumping.

3

Each thread walks the journey

It sends requests in order, waiting for each answer and pausing for timers.

4

Results are reported

Every finished request becomes a sample that listeners receive.

5

The test ends

Threads finish their loops, or the duration ends, or you press stop.

Everyday analogy

Picture a hundred shoppers released into a supermarket, each with their own list and their own trolley. They do not wait for one another. Each walks the aisles independently, and the till records every purchase.

SScaling Up Gently

Grow the load in steps, and stop when the picture changes.

Once the smoke test is clean, you can increase the load in planned steps. Each step answers a question and decides whether the next step is safe. Record the settings and the key numbers after each run.

RunUsersPurposeStop and investigate if
Smoke1Prove the plan worksAny error appears
Sanity5Prove it works with several usersErrors appear only with several users
Baseline20Record normal response timesTimes are unstable between repeats
Step up50, then 100See how times change as users growErrors rise or times climb sharply
HoldThe level chosenObserve steady behaviour for a longer timeTimes slowly drift upward
Everyday analogy

When lifting weights, you add plates a little at a time and stop at the first sign of strain. Jumping straight to the heaviest weight proves nothing and risks injury. A load test is the same.

What a step-up teaches

  • The point where response times begin to rise shows where the system starts to struggle.
  • The point where errors begin shows where it starts to fail.
  • The shape of the climb tells you whether the system degrades gently or falls over suddenly.
!
Watch out

Watch your own computer as well as the target. A load generator that runs out of memory or processor power gives you numbers about itself, not about the system you meant to test.

NNon-GUI Mode and the HTML Report

The window is for building. The command line is for running.

JMeter can run in two ways. In GUI mode you see the window with its tree and listeners. In non-GUI mode you start JMeter from a command line, name the plan and a results file, and it runs without any window. The official advice is to use the window to create and debug plans, and to run real load tests in non-GUI mode, because drawing windows and holding results costs memory and processor time.

flowchart LR
    A["Build the plan in the window"] --> B["Smoke test with one user and View Results Tree"]
    B --> C["Small run with a few users and Summary Report"]
    C --> D["Save the plan and disable heavy listeners"]
    D --> E["Run in non-GUI mode, writing a results file"]
    E --> F["Generate the HTML dashboard report"]
    F --> G["Read, compare, and share the report"]
FIG 4 · A healthy path from first plan to a shareable report.

The HTML dashboard report

JMeter can turn a results file into an HTML dashboard report, a small website with tables, charts of response times over time, throughput, percentiles, and error breakdowns. It is far richer than any live window, can be shared with a team, and costs nothing during the test, since it is built afterwards from the saved file.

Everyday analogy

A chef tastes and adjusts the recipe at home with notebook and scales. When the restaurant opens, the same recipe is cooked in bulk in the back kitchen. The window is the home kitchen, and non-GUI mode is the back kitchen.

i
Tip

Even for small tests, get used to saving a results file and building the report. The habit becomes automatic, and your results stay available for comparison later.

WWhy Heavy Listeners Slow Your Test

Watching the test can change the test.

Listeners must receive, store, and draw every sample. For a few users this costs nothing noticeable. For hundreds of users it can consume a large share of the memory and the processor of the load generator. When the load generator slows down, it sends requests late and handles answers late, so your response times include some of its own struggle.

ListenerWeightUse it for
View Results TreeVery heavyDebugging with one or a few users only
Graph ResultsHeavyQuick visual checks with a small number of users
Summary ReportLightCompact numbers for small and medium runs
Results file onlyLightestReal runs, with reports built afterwards
Everyday analogy

A race timekeeper who also paints a portrait of every runner will finish late and with inaccurate times. The work of measuring must not slow down the work being measured.

A simple rule

While you build the plan, keep the helpful listeners on. Before a real run, disable the heavy ones, keep a results file, and run without the window.

!
Watch out

A disabled listener costs nothing. If you want to keep debugging listeners in the plan for later, disable them rather than deleting them, and enable them again when needed.

OOrganising Files, Folders, and Versions

A tidy project folder keeps old tests useful.

After a few weeks, you will have several plans, data files, results files, and reports. Without organisation, nobody remembers which file belongs to which test. A little discipline from the start prevents a lot of confusion.

A simple folder layout

Plans

One folder for plans

Keep the plan files together, with clear names and version notes.

Data

One folder for data

Keep test data files beside the plans, with a note about what each contains.

Results

One folder per run

Name each run’s folder with the date and purpose, and store results, logs, and reports inside.

Notes

One short notes file

Record the settings, the key numbers, and any surprises for each run.

Everyday analogy

A well-labelled filing cabinet lets you find last year’s invoice in a minute. A heap of loose papers makes the same task an afternoon’s work. Your results folder is that cabinet.

Version control for plans

Because plan files are text, they fit naturally into version control systems. A history of changes tells you who changed what and why, and it lets you go back when an edit breaks something. Commit plans together with their data files, and write a short message with each change.

i
Production note

Do not commit large results files or secrets to version control. Keep results in a separate store, and keep passwords and tokens out of plans.

AAnatomy of a Finished First Plan

What the tree looks like when everything is in place.

After the steps in this guide, your first plan will have a tidy, readable tree. The diagram shows the finished shape. Notice that shared settings sit high, checks sit next to their requests, and result windows sit at the bottom.

flowchart TD
    TP["Test Plan: Shop first test"] --> UDV["User Defined Variables: search word, think time"]
    TP --> TG["Thread Group: Shoppers"]
    TG --> HD["HTTP Request Defaults: protocol and server"]
    TG --> CM["HTTP Cookie Manager"]
    TG --> HM["HTTP Header Manager"]
    TG --> CSV["CSV Data Set Config: search words"]
    TG --> S1["HTTP Request: Open Home Page"]
    TG --> S2["HTTP Request: Search for Product"]
    TG --> S3["HTTP Request: View Product Page"]
    S1 --> A1["Response Assertion: home heading"]
    S2 --> A2["Response Assertion: results heading"]
    S3 --> A3["Response Assertion: product heading"]
    TG --> TM["Constant Timer: think time"]
    TG --> L1["View Results Tree: disable for big runs"]
    TG --> L2["Summary Report"]
FIG 5 · The finished shape of a small, healthy first plan.
Everyday analogy

A well-organised kitchen has shared tools on the wall, ingredients in labelled jars, and a clear workspace. Anyone can walk in and understand it. A tidy tree gives a new team member the same feeling.

i
Tip

Ask a colleague to open your plan and describe what it does without your help. Wherever they stumble is where a name or a comment is missing.

MMonitoring While You Test

A load test measures from the outside. You also need to see inside.

JMeter shows you how long requests took, but not why. The reasons lie inside the system: busy processors, full memory, slow database queries, or exhausted connections. To understand a result, you need to watch the server’s own health while the test runs, on the same clock.

What to watch

  • On the target: processor use, memory use, disk and network activity, database response, and error logs.
  • On the load generator: its own processor and memory, so you know it is not the bottleneck.
  • In the test results: error rate, response time spread, and throughput.
Everyday analogy

A doctor takes a patient’s temperature, but also checks the pulse, the blood pressure, and the oxygen level. One number says something is wrong. The others say what.

A small habit

Write the start and end time of every run. Later, when you compare the results with the server’s graphs, you can line them up exactly and see what happened inside at the moment the response times changed.

i
Production note

Teams often send JMeter metrics to a monitoring dashboard through a Backend Listener, and watch them beside the server metrics. That is a later step. For a first plan, watching the server’s basic health in a separate window is plenty.

SSecurity, Permission, and Safe Testing

A load test is real traffic, and real traffic has real consequences.

Your virtual users are not pretend to the server. Each one sends genuine requests that consume genuine resources. That makes safety a part of test design, not an afterthought. A few simple rules protect you, your colleagues, and the system you test.

SAFETY CHECKLISTReview
Before the test

Confirm you have permission from the owner of the system. Prefer a test environment over a live one. Use test accounts and made-up data, never real customers. Tell the people who run the system when the test will happen.

During the test

Start small, watch the system’s health, and keep a clear plan to stop at once if something goes wrong. Avoid sending real emails, payments, or messages.

After the test

Remove test accounts and data you created, secure or delete result files, and remove any secrets from plans before sharing them.

Specific risks to remember

  • Look-alike attacks: heavy traffic can resemble an attack and trigger protective systems, or even a legal complaint.
  • Side effects: a request that places an order, sends an email, or changes data does so for real, every time.
  • Secrets in plans: passwords and tokens typed into a plan travel with the file when it is shared.
  • Result files: if saved in detail, they may contain tokens, personal data, or internal addresses.
Everyday analogy

A fire drill in a building is announced in advance, practised with care, and run with an exit plan. A surprise drill that blocks the doors is dangerous. Plan load tests like fire drills.

!
Watch out

Never test a system you are not authorised to test, whatever your intentions. Written permission protects everyone, including you.

AAdvantages, Disadvantages, and Trade-offs

Building plans in a graphical window is friendly, and it has limits.

Advantages

  • No programming needed for a useful first test
  • You see the structure of the plan as a tree
  • Immediate feedback through listeners
  • Free, open source, and widely used
  • Plans are text files that fit version control
  • A large library of elements for many protocols

Disadvantages

  • The window is not meant for large load runs
  • Large plans become hard to read and review
  • Merging two people’s edits to one plan is awkward
  • Invisible mistakes, such as a wrong scope, are easy to make
  • Realistic user behaviour needs thought and data
  • Reports need extra steps to be shared well
Trade-offWhat you gainWhat you give up
Build in the windowEase and visibilityEfficiency at large scale
Add many assertionsConfidence in correctnessSlightly more effort per request
Fetch embedded resourcesRealistic page loadsMore load and more variation
Use heavy listenersRich debugging detailMemory and processor capacity
Keep the plan smallClarity and maintainabilityCoverage of fewer user journeys
Everyday analogy

A hand-drawn map is quick, friendly, and good enough for a short walk. For a long expedition you want a more detailed, carefully checked map. The graphical window is the hand-drawn map.

PDesign Patterns for First Plans

Good habits repeat across good test plans.

Pattern

Small first, then grow

Start with a tiny plan, prove it, and add one element at a time.

Pattern

Defaults high in the tree

Put shared settings near the top, so every request borrows them.

Pattern

Assertion beside every key request

Check the content of every important response, so failures cannot hide.

Pattern

Names that explain

Name elements for what they do, so the report reads like a story.

Pattern

Debug listeners behind a switch

Keep helpful listeners in the plan, disabled by default, and enable them for debugging only.

Pattern

Values in variables

Keep server names, search words, and pauses in named variables, not buried in requests.

A pattern called “Build, Prove, Grow, Record”

1

Build

Add one element, and keep the plan simple.

2

Prove

Run a one-user test and check every response.

3

Grow

Raise users and add steps in small increments.

4

Record

Write down the settings, the numbers, and any surprises.

Everyday analogy

A good builder lays one row of bricks, checks it is level, and then lays the next. A wall built all at once and checked at the end tends to lean.

AAnti-patterns to Avoid

Some habits look efficient and cause pain later.

ANTI-PATTERN 01Avoid
The pattern

Starting with hundreds of users on a plan that has never run cleanly.

Why it hurts

A hidden mistake produces hundreds of errors, and nothing can be learned from the result.

Better approach

Prove the plan with one user, then five, then step up carefully.

ANTI-PATTERN 02Avoid
The pattern

Trusting status codes alone, with no assertions.

Why it hurts

Error pages with normal codes count as success, so the report looks healthy while users see failures.

Better approach

Add a content check to every important request.

ANTI-PATTERN 03Avoid
The pattern

Running large tests with all listeners on, in the window.

Why it hurts

The load generator spends its power drawing results, so measurements are slow and distorted.

Better approach

Disable heavy listeners and run in non-GUI mode with a results file.

ANTI-PATTERN 04Avoid
The pattern

Sending the same data from every virtual user, with no pauses.

Why it hurts

Caches answer instantly and the load is unrealistically harsh or gentle, so conclusions do not match reality.

Better approach

Use data files and timers to give each user varied, human-like behaviour.

ANTI-PATTERN 05Avoid
The pattern

Keeping the only copy of a plan on one laptop, with default element names.

Why it hurts

The plan is lost with the laptop, and nobody else can understand it.

Better approach

Store plans in version control, with clear names and comments.

TTroubleshooting Your Plan

Match the symptom with the usual cause.

SymptomLikely causeWhat to check
Nothing happens when I press StartThe Thread Group is disabled, or has no samplersThe enabled state and the tree structure
The test ends instantlyLoop count or duration set too small, or an error action stops the threadsThread Group settings
Numbers of samples are lower than expectedRequests were skipped, or threads stopped earlyControllers, the error action, and the log
Timers seem to have no effectMilliseconds mistaken for seconds, or the timer is out of scopeThe unit and the position in the tree
Assertion never failsThe marker text is too generic or sits in the wrong fieldBreak the assertion on purpose and see if it fails
Results differ every runWarm-up effects, shared environment, or generator limitsRepeat runs and monitor both sides
JMeter runs out of memoryToo many results held by listenersDisable heavy listeners and run without the window
Plan works for one user but not for manyShared data, sessions, or unique values collidingData files, cookies, and uniqueness of values
Cannot find the log fileIt sits in the working folder of the programThe folder from which JMeter was started

A method for any puzzle

1

Reduce to one user

Remove noise, and see whether the problem remains.

2

Read the results tree

Compare the request and response with what you expected.

3

Check the log

Look for error lines naming the element or the cause.

4

Compare with the browser

Repeat the request manually and spot the difference.

i
Tip

Change one thing at a time while fixing a problem. If you change three things and it starts working, you will not know which one helped.

AA Worked Example: The Shop Plan from Start to Finish

Follow an imaginary small shop’s first test, step by step.

A new tester is asked to check whether a small online shop copes with twenty shoppers at a time. She has permission to test the shop’s test environment. She plans a journey of three steps, with a short pause between them, and writes her goals on paper before opening JMeter.

flowchart TD
    A["Goal: 20 shoppers, three-step journey"] --> B["Build plan: thread group, defaults, cookies, three requests"]
    B --> C["Add timer, assertions, results tree, summary report"]
    C --> D["Smoke test: 1 user, 1 loop"]
    D --> E{"All green and correct?"}
    E -- "No" --> F["Fix plan and repeat smoke test"]
    F --> D
    E -- "Yes" --> G["Sanity run: 5 users"]
    G --> H["Baseline run: 20 users, 5 minutes"]
    H --> I["Save results, disable heavy listeners"]
    I --> J["Report and notes for the team"]
FIG 6 · A first test, from goal to report.
1

Plan on paper

She writes the journey: open the home page, search, open a product. She decides on twenty users, a thirty-second ramp-up, and pauses of two to four seconds.

2

Build the tree

She adds a thread group, HTTP Request Defaults with the shop’s address, a Cookie Manager, and three HTTP Requests with clear names.

3

Add the helpers

A random timer gives human-like pauses. A Response Assertion on each request checks a heading that only the right page contains. A results tree and a summary report show the outcome.

4

Smoke test

With one user, she sees all green marks. The product page assertion fails: the heading she chose appears only for logged-in users. She picks a better marker and tries again.

5

Grow

Five users run cleanly, then twenty for five minutes. Error percentage is zero and times are steady.

6

Record and share

She saves the plan, notes the settings and the key numbers, and starts planning a larger run in non-GUI mode.

What made it work

  • A clear, small goal written before building.
  • Shared settings placed once, high in the tree.
  • Assertions that caught a wrong marker during the smoke test.
  • Gentle growth in steps, with a record of each run.
i
Production note

This example is imaginary and simplified. Real tests add data files, correlation, and richer journeys, but the habits shown here carry over to every plan you will ever build.

CCommon Beginner Misunderstandings

Six ideas that beginners often get wrong.

Myth

“More users means a better test”

A bigger test is only better if the plan is correct and the target can safely take it. Start small.

Myth

“Green means success”

A green mark may only mean the status code was normal. Without assertions, wrong pages can still be green.

Myth

“Elements run from top to bottom”

JMeter runs element types in a fixed order. A timer below a sampler still runs before it.

Myth

“The window is fine for big runs”

The window is for building and debugging. Run big tests in non-GUI mode.

Myth

“One run tells the truth”

A single run can be affected by warm-up and neighbours. Repeat important tests.

Myth

“JMeter is a browser”

It sends requests and measures answers, but it does not run page scripts or draw pages like a browser does.

Everyday analogy

Everyone starting to cook believes that a hotter oven means faster, better cooking, and learns otherwise from a burnt tray. These myths are the burnt trays of load testing. It is cheaper to learn them from a guide.

A habit that corrects all six

Before trusting a result, ask three questions. Did the plan prove itself with one user? Are the responses actually correct, not just fast? Does the result repeat? Honest answers to those questions expose most misunderstandings before they cost you a conclusion.

!
Watch out

JMeter does not run the scripts inside web pages, so it measures how the server responds to requests, not how long a browser takes to draw the page. Tools that drive real browsers measure a different thing.

BBest Practices and Common Mistakes

A short checklist to carry into your next test.

1

Plan on paper first

Write the journey, the load, the pauses, and what success looks like.

2

Save early and often

Name the plan well and store it in a project folder.

3

Start with one user

Prove every request before adding more users.

4

Check content, not only codes

Add assertions to every important request.

5

Make users realistic

Use cookie handling, think time, and varied data.

6

Grow in steps

Raise the load gradually, and stop at the first sign of trouble.

7

Run big tests without the window

Use non-GUI mode, a results file, and the HTML report.

8

Keep records and stay safe

Note the settings and numbers, and test only with permission and test data.

Common mistakes in one list

  • Starting with too many users on an unproven plan
  • Trusting green marks with no content checks
  • Forgetting the Cookie Manager and losing sessions
  • Typing seconds where milliseconds are expected
  • Leaving heavy listeners on during large runs
  • Running big tests in the graphical window
  • Using real customer data in test files
  • Leaving default names on every element
  • Not recording which settings produced which result
Start small, prove it, grow carefully, and write it down.

RReal-World Scenarios

Five typical situations, described in general terms so you can adapt them.

The pre-launch check

A small company is about to launch a new product page, supported by a marketing email to ten thousand subscribers. The team builds a short plan with a home page, a product page, and a basket step, and runs it with increasing users in a test environment. They discover that the basket step slows sharply beyond a certain level, and fix a database setting before launch day.

The false comfort

A tester reports a perfectly green run. A colleague opens the results tree and finds that every response is a polite maintenance page. No assertions had been added. After adding content checks to each step, the very same test shows a ninety percent failure rate, and the team realises the environment had been down all along.

The lost session

A plan works for one user but fails with several. Each virtual user keeps being sent to the login page. The cause is a missing Cookie Manager, so sessions were never kept. Adding one element fixes the whole test, and the team makes it part of every new plan template.

The slow laptop

A tester runs one hundred users in the graphical window on an ordinary laptop with every listener enabled. The laptop struggles, and response times look terrible. When the same plan is run from the command line with a results file, the numbers improve markedly. The first measurements had mostly described the laptop.

The handover

A team member leaves, and a new one inherits a plan whose elements are all named with default names. It takes days to understand. The team then adopts simple rules: clear names, comments on every non-obvious element, and a short notes file in each plan folder. Later handovers take an afternoon.

Most first-test problems are simple. Good habits make them visible.

CChoosing What to Measure: Goals and Targets

A number means little until you know what number you were hoping for.

After your first run you will have figures: averages, maximums, error percentages. But are they good? That depends on a target, and a target comes from the needs of the people who use the system. Before a serious test, agree on a small set of goals with the people who care about the system, and write them down.

Goals worth agreeing on

GoalExample wordingWhere you read it
Response timeNine out of ten searches finish in under two secondsPercentile columns of the Aggregate Report or the HTML report
Error rateFewer than one in a hundred requests may failError % in the Summary Report
CapacityThe system handles two hundred shoppers at the same timeUsers in the Thread Group and steady response times
StabilityResponse times stay flat during a one-hour runCharts over time in the HTML report
Everyday analogy

A runner who says “I want to run fast” cannot tell whether the race went well. A runner who says “I want to finish ten kilometres in under an hour” can. A target turns a number into a verdict.

Why averages alone are not enough

An average can hide a slow minority. If nine requests take one second and one takes eleven seconds, the average is two seconds, yet one user in ten waited a long time. Percentiles describe this better, because they say what share of requests finished within a given time. For first tests the average is a fine start, but learn to read the percentile columns as soon as you can.

i
Tip

Write the goals at the top of your notes file before the first serious run. A goal chosen after seeing the results is a decoration, not a measurement.

MModelling a Mix of Visitors

Real traffic is a blend of different behaviours, not one identical journey.

In a real shop, most visitors only browse, some search, and a few buy. If every virtual user performs the whole journey including checkout, your test overstates the load on the checkout and understates the load on the home page. JMeter lets you shape the mix with controllers that choose among steps.

Two helpful controllers

Share

Throughput Controller

Runs its steps for only a chosen percentage of the passes, so the checkout can run for about one visitor in ten.

Choose

Random Controller

Picks one of its steps at random each pass, so visitors take different paths.

Several groups

More than one Thread Group

Give each type of visitor its own group with its own user count, such as many browsers and few buyers.

Everyday analogy

A cinema does not expect every guest to buy popcorn, a drink, and a poster. Most buy a ticket, some buy a snack, and a few buy everything. A realistic model reflects that mix.

Where the numbers come from

Real percentages should come from real evidence, such as website analytics or server logs, not from guesses. If no evidence exists yet, state your assumptions openly in the plan’s comments, and refine them when data arrives.

!
Watch out

Do not make the mix more complicated than your evidence supports. A simple, honest model that you can explain beats a clever model nobody trusts.

SShortcuts: Templates and the Recorder

JMeter can start a plan for you, but you still need to understand it.

Building by hand teaches you the most, but JMeter also offers two shortcuts. The first is templates, ready-made starter plans available from the File menu. Choosing one creates a small plan with the usual elements already in place, which you then adjust. The second is the HTTP(S) Test Script Recorder, an element that sits between your browser and the website and records the requests your browser sends, turning them into samplers.

ShortcutWhat it gives youWhat you must still do
TemplateA sensible starting structureFill in the server, paths, and assertions
RecorderA quick copy of a real browsing sessionRemove noise, name requests, add checks, and handle changing values
Everyday analogy

A tape recorder captures everything said in a meeting, including the coughs and the small talk. You still need to write the minutes. The recorder captures requests, and you still need to turn them into a tidy plan.

Cautions about recording

  • Recordings include every image, script, and advert request, so they need cleaning.
  • Recorded values that change on every visit, such as tokens, will fail when replayed.
  • Recorded names are poor, so rename every request to describe what it does.
  • Recording means installing a temporary security certificate for secure sites, so follow the documentation and remove it afterwards.
i
Production note

Experienced testers often record once to learn what a journey sends, then rebuild a clean plan by hand using only the requests that matter.

WWhere to Go Next: A Learning Path

Your first plan is the start of a skill, not the end of it.

Once your first plan works, a natural order of topics will take you from a beginner to a confident practitioner. Each step builds on the one before.

1

Extractors and correlation

Learn to capture values, such as tokens and identifiers, from responses and send them in later requests.

2

More assertions

Check status codes, headers, and structured data such as JSON, and learn which assertion suits which question.

3

Controllers and logic

Model real behaviour with conditions, loops, and transactions that group steps.

4

Properties and parameters

Move settings outside the plan so one plan runs in many environments.

5

Reports and monitoring

Read the HTML report, percentiles, and server metrics, and compare runs over time.

6

Scaling and automation

Run distributed tests, and automate runs in pipelines with pass and fail targets.

Everyday analogy

Learning to cook starts with boiling an egg, then moves to sauces, then to whole menus. Nobody expects a banquet on the first day. Each small success prepares the next.

i
Tip

Practise on a safe, small system that you own. Repeated small experiments teach more than a single dramatic one, and they cannot harm anyone.

QQuick Reference

A one-page summary you can keep next to your first plan.

Building blockWhere to add itWhat it does
Thread GroupUnder the Test PlanSets users, ramp-up, and loops
HTTP Request DefaultsUnder the Thread GroupHolds the shared server settings
HTTP RequestUnder the Thread GroupSends one request
Cookie ManagerUnder the Thread GroupKeeps sessions like a browser
Header ManagerUnder the Thread GroupAdds shared headers
TimerUnder the Thread Group or one samplerAdds think time in milliseconds
Response AssertionUnder a samplerChecks the content of the answer
CSV Data Set ConfigUnder the Thread GroupFeeds varied data to each user
View Results TreeUnder the Thread GroupDebug window, light use only
Summary ReportUnder the Thread GroupCompact table of results

Five questions before pressing start

  • Do I have permission to test this system, and am I using test data?
  • Did a one-user smoke test pass, with correct responses?
  • Do key requests have assertions that check content?
  • Are heavy listeners disabled for any larger run?
  • Have I saved the plan, and will I record the settings and numbers?

GA Glossary in Plain Words

The terms of this guide in one place.

TermPlain meaning
Test planThe tree of elements that describes a whole load test, saved as a file
ElementOne building block of a plan
ThreadOne virtual user, running in its own line of work
Thread GroupThe element that creates and controls the virtual users
Ramp-upThe time JMeter takes to start all the users
SamplerAn element that sends a request and waits for the answer
SampleThe recorded result of one request
Config ElementAn element holding shared settings or data
TimerAn element that adds a pause before a request
Think timeThe pause a real person takes between steps
AssertionAn element that checks that the answer is correct
ListenerAn element that shows or saves results
ControllerAn element that organises the order and repetition of steps
Smoke testA very small first run to prove the plan works
Non-GUI modeRunning JMeter from the command line with no window
ThroughputHow many requests are handled in a period of time
Everyday analogy

A glossary at the back of a travel guide lets you check an unfamiliar word without hunting through the chapters. Keep this one beside you while you build.

i
Tip

When a team conversation about a test gets confusing, check whether people are using the same word for different things, such as “user” and “request”. Agreeing on terms often solves the disagreement.

FFrequently Asked Questions

Quick answers to the questions beginners ask most often.

Q1What is a test plan in JMeter?
It is the tree of elements, saved in one file, that describes the users, the requests, the checks, and the result windows of a load test.
Q2What do I need to install?
A suitable version of Java and the JMeter download from the Apache site. JMeter needs no installer, so you unpack it and run it.
Q3Which element do I add first?
A Thread Group, which creates the virtual users. Then add defaults, samplers, and helpers beneath it.
Q4What is the ramp-up period?
The time JMeter takes to start all the users. Twenty users with a ramp-up of twenty seconds start about one per second.
Q5Why add a Cookie Manager?
So each virtual user keeps its own cookies and sessions, like a real browser. Without it, many sites treat every request as a stranger.
Q6What is think time and why does it matter?
It is the pause a real person takes between steps. Without it, virtual users send requests far faster than real people, so the load is unrealistic.
Q7Why does a green result not guarantee success?
A green mark usually means the status code was normal. The page itself may still be an error. Assertions check the content.
Q8How many users should I start with?
One, for a smoke test. Then five, then twenty, and step up carefully, watching errors and response times.
Q9Can I run large tests in the graphical window?
It is not recommended. Use the window to build and debug, and run large tests in non-GUI mode with a results file.
Q10What does the Summary Report show?
One row for each request name, with counts, times, error percentage, throughput, and data rates.
Q11How do I give each user different data?
Use a CSV Data Set Config element that reads a file of values, and refer to the columns by name in your requests.
Q12Where is the plan saved?
In a file with the jmx extension, in the place you choose when you save. Keep it in a project folder of its own.
Q13Is JMeter the same as a browser?
No. It sends requests and measures answers, but it does not run page scripts or draw pages. It measures server response, not the browser’s drawing time.
Q14Is it safe to test any website?
No. Only test systems you own or have permission to test, preferably a test environment, using test data.

SSummary and Key Takeaways

Your first JMeter test plan is a small tree: a Thread Group for the users, shared defaults and a Cookie Manager for realism, a few requests in the order a visitor would send them, a timer for human pauses, assertions that check the content, and a couple of listeners to show what happened. You build it one element at a time, prove it with a single user, and then grow the load in careful steps. When the plan is solid, you move to non-GUI mode, keep a results file, and build a report. If you remember one idea, let it be this: start small, prove everything, grow gradually, and write down what you did.

Key Takeaways

  • A test plan is a tree of elements. The Thread Group creates users, samplers send requests, timers add pauses, assertions check answers, and listeners show results.
  • Position sets scope. Shared settings go high in the tree, and checks go beside the requests they belong to.
  • Prove before you grow. Run a one-user smoke test first, then five users, then step up while watching errors and response times.
  • Check content, not only codes. A green mark may hide an error page, so add assertions to important requests.
  • Make users realistic. Use a Cookie Manager, think time, and varied data so the load resembles real traffic.
  • The window is for building. Run large tests in non-GUI mode with a results file, disable heavy listeners, and build the HTML report afterwards.
  • Test safely and keep records. Use only systems you may test, use test data, and note the settings and numbers of every run.