DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Autonomous QA Testing With Playwright, LangGraph, and GPT-4o on AWS
  • Load Testing Essentials for High-Traffic Applications
  • A General Overview of TCPCopy Architecture
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps

Trending

  • You Don't Have to Pick One: A Hybrid Approach to Enterprise Data Refresh
  • How to Format Articles for DZone
  • Introducing senro: A Pipeline Engine You Program in Go
  • How to Migrate From C/C++ to Rust: A Practical Guide for Embedded IoT Systems

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Record and Play Load Testing in 5 Steps

Record and Play Load Testing in 5 Steps

Learn more about record and playback load test scenarios in this post!

By 
Canberk Akduygu
·
Mar. 12, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
7.6K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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 the initial server to third-party applications, 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, it 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 one item that 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, 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 five 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 third option but there’s a slight difference. Transaction Controller lets you aggregate the results under one label. The controller doesn’t.
  • 5) Store the 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 is about a newspaper website and 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!

Load testing Record (computer science) Requests Testing Test script

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Autonomous QA Testing With Playwright, LangGraph, and GPT-4o on AWS
  • Load Testing Essentials for High-Traffic Applications
  • A General Overview of TCPCopy Architecture
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook