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)
1. Install Java run time in your PC
2. download Jmeter release.
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:
- Create your first test plan by creating thread group:
- Added Thread group:
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.
Samplers describes that “Jmeter sends web requests to server and wait till response comes.”
In this sampler, you can add parameters to send request to server to run the service.
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:
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.
In this way your simple test plan of a web service get executed.