This tutorial explains how to record JMeter test scenarios easily.

Prerequisites:  JMeter & Java JDK download and setup

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

  • Browser proxy setup
  • JMeter HTTP/HTTPS recorder setup

1- Browser proxy setup

Tools -> Options -> Advanced -> Settings

mozilla_proxy

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


2- JMeter HTTP/HTTPS recorder setup

First of all we need to add thread group to 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 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 Start button on Http(s) Script Recorder

certificate

We will see a message which tells that a temporary certificate named ApacheJMeterTemporaryRootCA.crt has been created in JMeter bin directory, just click on 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.