Skip to main content
Back to blog
tutorials 30 April 2020 4 min read (Updated: 28 August 2026)

HAR to JMX File

Capture network traffic in Chrome as a HAR file and turn it into a JMeter JMX test plan — the conversion options, and why a raw conversion is never a working test.

M

Mark

Performance Testing Expert

This guide walks through capturing network traffic in Chrome as a HAR file and converting it to Apache JMeter’s JMX format for performance testing — and, just as importantly, what you still have to fix afterwards before the script will actually run.

What is a HAR File?

HAR (HTTP Archive) is a JSON-formatted archive file format for logging web browser interaction with a site. It captures all network requests, responses, headers, cookies, and timing information.

Capturing HAR Files

  1. Open Chrome’s Developer Tools (Ctrl + Shift + I)
  2. Navigate to the Network tab
  3. Browse through the pages you want to capture
  4. Right-click in the Network panel
  5. Select “Save all as HAR with content”

Capture “with content” if you can. The response bodies are what any tool needs in order to work out which values a later request is echoing back — see correlation below.

Converting to JMX Format

Apache JMeter does not natively support HAR files, so the recording has to be converted.

A straight conversion. Our free HAR to JMX converter takes a HAR and gives you back a JMX — or a k6 or Gatling script — with the recording’s own timings kept as think times. It runs inside your browser tab: the recording is never uploaded, which matters here more than usual, because a HAR captured with content holds every cookie, token and response body from the session you recorded. It is free up to 25 requests, which covers a single user journey. BlazeMeter’s converter is another browser-based option, and JMeter’s own Templates > Recording, driven through the HTTP(S) Test Script Recorder, gets you to a similar place without leaving JMeter.

A conversion that also correlates. None of the above extracts anything — including ours, deliberately: the browser converter replays the recorded values as they were captured, and tells you so on the result. Perf Script Studio reads the HAR and emits a runnable JMeter, k6 or Gatling script, with the dynamic values already extracted (see below), think times taken from the recording’s own timings, and parallel requests grouped as JMeter models them. It is a paid command-line tool, and it exists precisely because of the section that follows.

Why a raw conversion is not yet a test

This is the part most guides skip, and it is where the time actually goes.

A HAR is a record of one session that already happened. Replay it unchanged and every request carries values that were only valid at the moment of capture:

  • Session identifiers. The JSESSIONID or sid in the recording belonged to the browser that made it. Replayed, you are sending someone else’s expired session.
  • CSRF tokens. Issued per form render. A replayed token is rejected, usually with a 403 that looks like a permissions bug.
  • Generated identifiers. Order numbers, cart ids, upload references — all minted by the server during the recording and meaningless on the next run.
  • Timestamps and nonces. Anything the server checks for freshness.

Fixing this is correlation: extracting the value from the response that produced it and substituting it into the requests that use it. In JMeter that means a JSON Extractor, Regular Expression Extractor or Boundary Extractor per value, and a ${reference} everywhere the literal appeared — how to find and extract those values is a guide of its own.

The trap is that a script with none of this in place still runs. It returns 200s from the login page and 403s or empty results everywhere after, and under load every virtual user sends the same stale token — which is not a load test of anything.

What else to fix after converting

  • Remove what you are not testing. Static assets, analytics beacons and third-party scripts are most of a HAR by request count and rarely part of the thing under test.
  • Add a Cookie Manager. Without one JMeter keeps no session at all between requests.
  • Check think times. A replay with no pauses is not user behaviour; it is a spike test you did not mean to write.
  • Add assertions. A 200 with an error page in the body is a pass until you assert on the content.
  • Parameterise the inputs. One recorded username is one user; a CSV Data Set Config is a population.

Using the converted file

Open the resulting JMX in JMeter. You should have a test plan containing the captured HTTP requests, headers, cookies and parameters — a starting point, not a finished script. Work through the list above before you trust a number that comes out of it.

Tags:

#jmeter #har #chrome #test-recording #correlation

The cheat sheets, as printable PDFs

All 52 are free to read on the site — no signup. Want them as A4 PDFs you can actually print? The pack covers JMeter, k6, Gatling, Docker, Kubernetes and observability, and costs nothing but an email address.

Get the PDF pack

Delivered by email. Unsubscribe any time — see our privacy policy.

Stuck on this in your own test suite?

I take on fixed-price, fixed-turnaround performance work — script migrations, HAR-to-script conversion and written performance audits. No calls required.

Get in Touch