JMeter Recording Scenario

In this tutorial, we will learn how to record JMeter test scenarios easily. JMeter Recording Scenario operation is critical for web performance tests. You can first record a scenario, then clean the unnecessary part of the recordings. Then, you can add your custom JMeter elements based on your performance test scenario.

Prerequisites:  JMeter & Java JDK download and setup

We will learn together how to set up and use the Apache JMeter HTTP(S) Test Script Recorder to record HTTP requests. JMeter comes with a built-in script recorder that works as a proxy server. You can follow the steps to complete this tutorial.

  • Browser proxy setup
  • JMeter HTTP/HTTPS recorder setup

Browser Proxy Setup for JMeter Recording Scenario

Tools -> Options -> Advanced -> Settings

mozilla_proxy

On popup enter the IP address and port in our case is localhost and port =7000

JMeter HTTP/HTTPS Recorder Setup

First of all, we need to add a thread group to the test plan.

Test Plan –> Add –> Threads (Users) –> Thread Group

ThreadGroup

Right click “Add -> Config Element -> HTTP Request Defaults

http_request_defaults

HTTP Request Defaults element -> Server name:  www.teknosa.com

Now its time to add controller right click on Thread Group  follow “Add -> Logic Controller -> Recording Controller”

recording_controller

Change controller name as “My First Recording”

My_First_Recording

Workbench –> Add –>Non-Test Elements –> HTTP(S) Test Script Recorder after we add this element we can record the scenario.

https_script_recorder

You can add url pattern as regular expression, you include or exclude contents (e.g. *.jpg, *.png, *.js, etc)

Example: I will add pattern to exclude image files.

.*\.png .*\.jpg .*\.gif

exclude_pattern

When we click on the Start button on HTTP(s) Script Recorder

certificate

We will see a message which tells us that a temporary certificate named ApacheJMeterTemporaryRootCA.crt has been created in the JMeter bin directory, just click on the OK button.

Now you can check your recorded requests.

scenario_record2

As a result, you can save time and have more realistic scenarios using Test Script Recorder.

Thanks.
Onur Yazir

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.