Convert HAR files to JMeter test plans

An easy way to record a load testing script

Any seasoned performance and automation tester will be aware the Number One Myth, that record & playback is rarely an accurate representation of user behavior. There is no such thing as a script-less process. Performance testers need to understand the sometimes complex chain of requests and responses their web application makes, most likely at the protocol level. It would be foolish to think otherwise.

However a recorded script is a great starting point for those cognizant of this fallacy. Recordings can save you a lot of time, particularly around preparation of complicated forms and parameters. That's why we've created a HAR to JMX converter.

Recording HAR files

Forget about proxy recorders and nuisance SSL certificates. You already have a powerful tool right in front of you. Your browser!

.har is a common filename extension denoting an HTTP Archive file. It is a JSON-formatted file that contains a trace of your web browser's interaction with a given site. Most modern browsers such as Chrome and Firefox have the ability to record network activity and export the trace as a HAR file or copy its contents to the clipboard.

See below for a quick demonstration of tracing network requests and responses via Chrome for our own script challenge

Converting HAR files to JMX

Our converter will convert your copied HAR string into a JMeter formatted test plan (.jmx), saving you the hassle of creating it manually. It's easy to try. See below for a quick demonstration.

Note from the future: We don’t run the service to convert a .har file to a .jmx anymore, but if you’d like to use it, we’ve made the tool available for you to download here.

Open in JMeter

Once converted, just open the downloaded test plan in JMeter and resume editing. The converter will do things like automatically create POST parameters and detect if requests were made with XML HTTP Request Headers. Behind the scenes, we're just using our popular ruby-jmeter gem. It's all open source, so you could easily expand on the example here.

See below for a quick demonstration of the converted test plan.

Start load testing now

It only takes 30 seconds to create an account, and get access to our free-tier to begin load testing without any risk.

Keep reading: related stories
Return to the Flood Blog