What is Jmeter?
Apache JMeter is used as a load testing tool for analyzing and measuring the performance of a variety of services of web application.
Jmeter is a java based open source software tool.
JMeter can help you to do regression testing of your application by creating test scripts for web services.
JMeter runs in two modes:
- GUI mode (which runs on windows)
- Non-GUI mode (which runs on Linux)
Use of Jmeter?
JMeter can be used as a unit test tool for database connections, web services, etc.
Jmeter uses to test the load and performance of the web services.
Running Jmeter in GUI mode (which runs on windows)
Installation:
1. Install Java run time in your PC
url:- http://www.java.com/en/download/index.jsp
2. download Jmeter release.
url:- http://jmeter.apache.org/download_jmeter.cgi
3. Extract in your specify folder like as C://
run the file (C://jakarta-jmeter-x.x/bin/jmeter.bin)
Start the Jmeter interface, i.e. jMeter windows batch file from bin folder.
How to run JMeter?
Steps to run JMeter are as follows,
- Start JMeter windows batch file from bin folder, it will open interface as shown in below:Image may be NSFW.
Clik here to view. - Create your first test plan by creating thread group:Image may be NSFW.
Clik here to view. - Added Thread group:Image may be NSFW.
Clik here to view.
Here thread group consists of 3 main properties,
a. Number of threads(users): It consists of number of requests you want to run in one test plan.
b. Ramp-up period (in seconds): It tells us how long all requests takes time to run. If there are multiple requests, then all requests get run one by one.
c. Loop count: It shows count that all requests get run in how many loops.
All samplers and listeners are involved in thread group.
4. Adding sampler:Image may be NSFW.
Clik here to view.
Samplers describes that “Jmeter sends web requests to server and wait till response comes.”
5. Sampler (e.g: Http Request):Image may be NSFW.
Clik here to view.
In this sampler, you can add parameters to send request to server to run the service.
6. Add listener:Image may be NSFW.
Clik here to view.
Listener, where test data and result get stored and it displays the output in different ways. Here added listener is “View as a tree”.
7. Run the test plan with result tree:
Now Select listener and run the test plan.Image may be NSFW.
Clik here to view.
In this listener, output gets display in detail with,
a. Sample result: Where load time, sample count get displays to you.
b. Request: What request you send to server.
c. Response data: The exact output comes from server.
8. Run the test plan with result table: Here, table shows all results in tabular form with no. of requests and average time for all requests.Image may be NSFW.
Clik here to view.
In this way your simple test plan of a web service get executed.
Image may be NSFW.
Clik here to view.
Clik here to view.
