2020 / 1 / 27
Apache JMeter Test Script Recorder: Part 1
After using JMeter, you guys must be wondering does there exist any way to record browser interactions with JMeter? Well, the answer is YES!!! You can definitely record the interactions but you need to do some preliminary setup to get things done. JMeter's HTTP(s) Test Script Recorder is designed to record test scenarios.
In this blog post, our aim will be to get your system i.e. your JMeter ready for recording the browser interactions. For that you need to do the following:
In the next blog post, we will see how to intercept and record HTTPS requests.
How Proxy Works???
All of you must be aware of How a Proxy actually works.Proxy is nothing but a component that is placed between you and a remote server. What Proxy do is to pass your queries to the remote server and at the same time, it transmits the result sent by the remote server to you. This means if we use JMeter as a Proxy, it can record all of your browser interactions with a server whether HTTP or HTTPS.
You are right, How to use JMeter as a Proxy? The answer is very simple, JMeter Test Script Recorder is designed in a way to provide this functionality of Proxy.
Configure Browser to use JMeter Proxy:
1. Open Firefox.
2. Open Preferences. There are 3 ways to open Preferences.
3. Go to the bottom of the page. Click on the Settings button under the Network Settings.
4. On the new pop up window, check Manual proxy configuration.
Google Chrome Setup:
JMeter Recorder Template is the easiest way to get started with recording HTTP requests.
1. Launch JMeter in GUI Mode.
2. Click on Files->Templates.
3. In the dialog box that appears, select Recording with Think Time in the drop-down list Select Template.
If you carefully observe the HTTP Test Script Recorder Settings window. You will observe that there are 3 types of Settings that need to be done:
1. Global Settings: This has 2 fields:
2. Test Plan Content: There are 3 fields:
3. HTTP Sampler Settings:
6. In the HTTP Request Defaults element:
7. Return to HTTP(S) Test Script Recorder, and click the Start Button at the top.
Clicking on the Start button will start the JMeter Proxy Server to intercept the browser requests. Please Note this setup was for HTTP Requests. For HTTPS Requests you need to setup JMeter CA Certificate.
If any user enters the URL that is not HTTP. JMeter will show a message that
Root CA Certificate is created in JMETER_HOME/bin directory. You need to install this certificate in your browser. The validity of this certificate is 7 days. In the next blog post, we will be discussing with you how to install the ROOT CA Certificate and will also tell you a hack to increase the validity of this certificate so that you don't need to update it after every 7 days.