I have tried to chip in some basic steps on how to use JMeter for the performance test. This will help any user to download JMeter and run a test.
- Go to http://jmeter.apache.org/
- Click on “Download Releases” link from Download menu.
For just using the tool we need only the binary release. The screen below shows the current version at the time of writing this document. Click on the ZIP version given below and use any standard UNZIP utility to extract the files.
Alternately we can save the TGZ file and extracted the contents by using 7Zip utility for windows. After extracting the TGZ file we get a folder named Jakarta-JMeter-n.n.n, where n.n.n is the version number which we downloaded.
Starting Apache JMeter tool:
The executable script for Windows platform is jmeter.bat for Linux systems it will be JMeter.sh.
These scripts are used to start JMeter in GUI mode. Double click the jmeter.bat script to start the tool. Or else we can start JMeter by using a command prompt.
For windows, if zip file is unzipped at C drive, then path for the jmeter.bat is
C:JMeterjakarta-JMeter-2.6bin
Double clicking the jmeter.bat file will start one command prompt and the JMeter utility in GUI mode. The command prompt is tied with the GUI and hence cannot be closed. If the command prompt is closed the GUI will terminate. We can keep the command prompt minimized while working with JMeter GUI. The command prompt is useful in viewing any JMeter exceptions that may occur.
JMeter proxy Step-by-step
This document explains the exact steps for JMeter’s proxy. One easy way to create a test plan is to use the Proxy. Proxy is used to record the requests sent to the server.
Basic Proxy Instructions
1. Go to JMETER_HOME/bin and start JMeter.
2. Select “Test Plan” on the tree
3. Right click on the “Test Plan” and add a new thread group: Add > Threads (Users) >
Thread Group
4. Select the Thread Group
5. Right click “Add -> Config Element -> Http Request Defaults”
6. In new HTTP Request Defaults element: Server name – enter “www.google.co.in”
7. Path – leave blank
8. Right click on the “Thread Group” and add a recording controller: Add > Logic Controller >Recording Controller
9. Next, select WorkBench
10. Right click on WorkBench and add the Http proxy: Add -> Non-test elements -> Http
Proxy Server
11. On HTTP Proxy Server, click the “Add” button in “URL Patterns to Include”. This will create a blank entry.
12. Enter “.*.html”
13. Click 3 times, the “Add” button in “URL Patterns to Exclude”. This will create 3 blank entries.
14. Enter “.*.png” pattern, “.*.gif” pattern and “.*.ico” pattern
15. Right click on “HTTP Proxy Server” and add a listener: Add -> Listener -> View Results Tree.
16. Return to HTTP Proxy Server, and click the “Start” button at the bottom
Configure your browser to use the JMeter HTTP Proxy
At this point, JMeter’s proxy is running. We will use Firefox to view some pages on Google
- Start Firefox, but do not close JMeter.
- From the tool bar, click “Options”. This should bring up the options.
- Select the “Advanced” tab, and “Network” tab
- Click “Settings” button near the bottom.
- On the new popup, check “Manual proxy configuration”. The address and port fields should be enabled now.
- Address – enter “localhost” or the IP address of your system
- Port – enter “8080”.
- Check “Use this proxy server for all protocols”
- Click “ok” button
- Click “ok” button again. This should return you to the browse
Record your navigation
- With your browser, in the “Address” bar at the top, enter “www.google.coml” and hit the “enter” key.
- Enter some search string in the google search.
- Click on few links available on the result page.
- Close your browser and bring up the JMeter window.
- Select “Thread Group”
- Right click “Add -> Listener -> Summary Report” to add summary listener.
- The summary listener will show some basic statistics.
- Select “Thread Group”
- Number of Threads – enter “5”
- Ramp up Period – do not change
- Loop Count – enter 100
Start the test
At this point, we are ready to run our test plan and see what happens. Save the test plan.
When you’re ready to run the test, there are two ways:
1. Run -> Start
2. Ctrl–R
Before you start the test, select “Summary Report”. As the test runs, the statistics will change
until the test is done. At the end of the test, the summary report should look like this.
While the test is running, in the upper right-hand corner, there should be a green square.
When the test is done, the box should be grey.