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
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
Right click “Add -> Config Element -> 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”
Change controller name as “My First Recording”
Workbench –> Add –>Non-Test Elements –> HTTP(S) Test 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
When we click on Start button on Http(s) Script Recorder
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.
As a result you can save time and have more realistic scenarios using Test Script Recorder.