- Load testing Report
- Summary
- Introduction
- Install
- Prerequisites
- Elements of a Minimal Test Plan
- Test Plan
- Collection of API
- Read Test Data from CSV file in Jmeter
- Test execution from GUI
- Test execution from the Terminal
- Make csv File
- Make jtl File
- Make html File
- HTML Report
- Transaction Per Second
Concurrent Request | Loop Count | Avg TPS for Total Samples | Error Rate | Total Concurrent API request |
---|---|---|---|---|
1 | 1 | 1.98 | 0% | 6 |
100 | 1 | 49.10 | 0% | 600 |
500 | 1 | 238.45 | 0% | 3000 |
1000 | 1 | 323.90 | 0% | 6000 |
2000 | 1 | 313.52 | 0% | 12000 |
- Server can handle almost concurrent 2000 API call with almost zero (0) error rate.
This document explains how to run a performance test with JMeter against a Booking Site.
Java
https://www.oracle.com/java/technologies/downloads/
JMeter
https://jmeter.apache.org/download_jmeter.cgi
Click =>Binaries
=>apache-jmeter-5.6.2.zip
- As of JMeter 4.0, Java 8 and above are supported.
- we suggest multicore cpu's with 4 or more cores.
- Memory 16GB RAM is a good value.
-
Thread Group
The root element of every test plan. Simulates the (concurrent) users and then run all requests. Each thread simulates a single user.
-
HTTP Request Default (Configuration Element)
-
HTTP Request (Sampler)
-
Summary Report (Listener)
Testplan > Add > Threads (Users) > Thread Group (this might vary dependent on the jMeter version you are using)
-
Name: Users
-
Number of Threads (users): 1, 100, 500, 1000, 2000
-
Ramp-Up Period (in seconds): 10
-
Loop Count: 1
-
The general setting for the tests execution, such as whether Thread Groups will run simultaneously or sequentially, is specified in the item called Test Plan.
-
All HTTP Requests will use some default settings from the HTTP Request, such as the Server IP, Port Number, and Content-Encoding.
-
Each Thread Group specifies how the HTTP Requests should be carried out. To determine how many concurrent "users" will be simulated, one must first know the number of threads. The number of actions each "user" will perform is determined by the loop count.
-
The HTTP Header Manager, which allows you to provide the Request Headers that will be utilized by the upcoming HTTP Requests, is the first item in Thread Groups.
-
- For creating Booking: https://restful-booker.herokuapp.com/booking
- For getting, updating, deleting Booking: https://restful-booker.herokuapp.com/booking/id
- File > Open (CTRL + O)
- Locate the "OPENCART_T1.jmx" file contained on this repo
- Continue open OPENCART_T1 to OPENCART_T6
- Open those file
- The Test Plan will be loaded
-
Create a CSV file in the test suite folder and add test data to it.
-
Add a Config Element CSV Data Set Config in Jmeter.
- Configure ' CSV Data Set Config ' based on the need such as providing path of CSV file and variable names and other configs.
-
Run the test to see if data from the CSV file is read and populated in the results.
-
Run the test to see if data from CSV file is read and populated in the results.
-
JMeter should be initialized in GUI mode.
-
Check Different Types of Report.
Summary and Aggregate Report for Number of Threads 1 ; Ramp-Up Period 10s
Summary Report Aggregate Report Aggregate Report for Number of Threads 2000 ; Ramp-Up Period 10s
Aggregate Report
- JMeter should be initialized in non-GUI mode.
- Make a report folder in the bin folder.
- Run Command in jmeter\bin folder.
- n: non GUI mode
- t: test plan to execute
- l: output file with results
jmeter -n -t BookingApp_csv_dataset_t1.jmx -l BookingAppLoadTesting\report\BookingApp_csv_dataset_t1.csv
jmeter -n -t BookingApp_csv_dataset_t1.jmx -l BookingAppLoadTesting\report\BookingApp_csv_dataset_t1.jtl
Then continue to upgrade Threads( 1, 100, 500, 1000, 2000 ) by keeping Ramp-up-Period Same.
After completing this command
jmeter -g BookingAppLoadTesting\report\BookingApp_csv_dataset_t1.jtl -o BookingAppLoadTesting\report\BookingApp_csv_dataset_t1.html
-
g: jtl results file
-
o: path to output folder
Number of Threads 1 ; Ramp-Up Period: 10s
Requests Summary | Statistics |
---|---|
Number of Threads 100 ; Ramp-Up Period 10s
Requests Summary | Statistics |
---|---|
Number of Threads 500 ; Ramp-Up Period 10s
Requests Summary | Statistics |
---|---|
Number of Threads 1000 ; Ramp-Up Period 10s
Requests Summary | Statistics |
---|---|
Number of Threads 2000 ; Ramp-Up Period 10s
Requests Summary | Statistics |
---|---|
Transaction Per Second Number of Threads 2000 ; Ramp-Up Period 10s