Record and Play Load Testing in 5 Steps | Loadium

Record and Play Load Testing in 5 Steps

While Apache JMeter allows you to create a load test from scratch, it also gives you the opportunity to Record and Playback load test…

Record and Play Load Testing in 5 Steps

While Apache JMeter allows you to create a load test from scratch, it also gives you the opportunity to Record and Playback load test scenarios for your web or mobile applications. Recording performance test scenarios are very useful when it comes to web or mobile testing. Websites and mobile applications make many requests varying from initial server to 3rd party application like analytics sites etc. Therefore implementing those requests from scratch may not be the best idea. In those cases, we recommend you to use the Recording module of JMeter.

JMeter has a special module for that purpose. It’s called HTTP Test Script Recorder. This module works as a proxy on the host and port that you provide and listen to the HTTP requests. Then creates HTTP Sampler for recorded requests.

How to Configure HTTP Test Script Recorder

Step 1

Go to Non-Test Elements and select the module.

In that screen, you will see many configuration elements. Some of them are mandatory, some are not.

  • Port is mandatory. This port number will also be used in your browser. So select an empty port. JMeter proxy is not ready with basic configuration.

Step 2

Others configuration items are optional. But there is on item, you should configure from our experience. That’s the Grouping section. During script recording, we’ll simulate an end to end test. Therefore many pages, many jpeg or CSS files will be captured. But we need to distinguish which request is made on which page or application module so that during execution, JMeter will create readable reports.

There are 5 choices

  • 1) Do not group sampler: Don’t use this one for your sake. Every request will be listed on the same label and it’s not easy to distinguish which request belongs to which action you made during test recording.
  • 2) Add a Separator Between Each Group: A basic separator will be added between every action you made during recording.
  • 3) Put Each group in a new Controller: This will also record your test scenario according to your actions and create a Controller for each action you made.
  • 4) Put each group in a New Transaction Controller: That’s basically the same as the 3rd option but there’s a slight difference. Transaction Controller lets you aggregate the results under one label. The controller doesn’t.
  • 5) Store 1st Sampler of each group only: This one will save only the first request of every action you made. That might not be the best solution as we mostly want to capture all requests.

Step 3

There is another config that you might want to do. That’s “Which file to be excluded during recording?”.

Add file extensions that you don’t want to capture to URL Patterns to Exclude.

Regular expression pattern is .*\.extensionName.*

The reason we do this is that those files are mostly dynamic and they are likely to change in near future. This about a newspaper website, images are changing every minute. So there’s no need to capture those things. We are able to call dynamic content by making a small configuration.

Step 4

This configuration can be done by adding an HTTP Request Defaults to your test plan.

Add an HTTP Request Default, then go to the Advanced tab. Select Retrieve All Embedded Resources

Now JMeter will always request the most updated embedded content for the pages that you visit. Think about creating a Random Product when clicking on an e-commerce web page. Every time we hit another product, JMeter will ask about the resource for those products when this is configured.

Step 6

Configure your browser’s proxy settings to JMeter’s setting that you made in step 1. Then hit the Start button in Test Script Recorder.

Now you can capture any request.

Happy load testing!

Latest articles

All Articles →

Postman Alternatives for Api Testing

Postman Alternatives for Api Testing

How To Use Json Extractor in Jmeter

How To Use Json Extractor in Jmeter

What Is Multi Location Load Testing

What Is Multi Location Load Testing