With every release of JMeter, you can notice some improvements. In the latest versions recording has been improved to better handle embedded resources and creation of certificates on the fly. For efficient working, the latest version of java/JDK is preferred.
How to Install JMeter?
Download the latest version of JMeter available at https://JMeter.apache.org/. Extract the folder onto a specified location. Make sure the latest version of java/JDK is installed on the system. If not, install the java and set the environmental variables accordingly.
Get Started with JMeter
- Go to JMETER_HOME/bin and start JMeter with JMeter.bat on Windows.
- JMeter UI will launch as shown below:
Building up a Test Plan
- Select “Test Plan” on the tree.
- Right click on the “Test Plan” and add a new thread group: Add > Threads (Users) >Thread Group.
- Select the Thread Group.
- Right click “Add > Config Element > HTTP Request Defaults”.
- In new HTTP Request Defaults element: Server name – let’s say “JMeter.apache.org”.
Path – leave blank
- Right click on the “Thread Group” and add a recording controller: Add > Logic Controller >Recording Controller.
- Next, select Workbench.
- Right click on Workbench and add the recorder: Add -> Non-Test Elements -> HTTP(S) Test Script Recorder.
- On HTTP(S) Test Script Recorder, click the “Add” button in “URL Patterns to Include”. This will create a blank entry; enter “.*\.html”.
- Right click on “HTTP(S) Test Script Recorder” and add a listener: Add > Listener > View Results Tree.
- Return to HTTP(S) Test Script Recorder, and click the “Start” button at the bottom.
- This will start the JMeter proxy server which is used to intercept the browser requests. A file called ApacheJMeterTemporaryRootCA.crt will be generated in JMeter/bin folder. Install this certificate in your browser.
Configure your Browser to use the JMeter Proxy
At this point, JMeter’s proxy is running. Start up the Browser, but do not close JMeter. Set your browser to use the manual proxy and port (same as of JMeter) for all protocols i.e. Local host: 8080
Record your Navigation
Now we are ready to record our application/flow. Enter the URL of the application and navigate the flows. Close your browser and bring up the JMeter window. Expand the thread group and there should be several samplers. At this point, the test plan can be saved as it is. If you forget to add default HTTP Request settings, you will have to manually delete the server name, and port.
In this sample, there aren’t any default request parameters. If a particular request parameter is required by all pages, the request defaults are where one would add the entries.
- Select “Thread Group”.
- Right click “Add -> Listener -> Summary Report” to add up a summary listener.
- The summary listener will show some basic statistics like average response time, Minimum response time, Maximum Response time, Throughput, etc.
You may also like: How to Download and Install JDK?