JMeter Performance Testing(Multiple user login)
Hi!! friends in this blog we are going to see the performance testing with multiple users login with multiple purchase order
Performance Testing
Performance Testing is the process of analysing the quality and capability of the product, in this method we can see the system performance in speed, stability under varying workload.
Thread Group
The Recorded Script we have to open the jmx file into the Apache J meter
Note: Record the script with help of Blaze meter
Note: In the Thread Group I have given the multiple users 10 and should set the ramp up seconds — the times that takes to login one by one users
J meter Slider
Thread group holds the controllers, samplers, config elements also the listeners Under the Thread Group we can find the
- Transaction Controller — Used to group multiple sampler request into one.
Login Request
In the Login API we used ”post”, the body data as email and password which as variable.
Regular Expression Extractor
It is post processor that can be used to apply regex on response data.
In the Login Http request we have to add==>Poset processors==>Regular Expression Extractor
Inside the login API in the field of response header we will set as:
- Name of the variable: we can set any variable name in the given field BearerToken
- Regular expression: authorization: (.*)
- Template: 1
- Match No: 0 If we give 0 the random values will be taken
- Default value: Not found
If Controller
It allows to determine whether or not to run a batch of child samplers, according to certain conditions
Set the:
Name: e.g. Login Successfully
Comments: e.g. Will Execute Only if BearerToken Generated Successfully
Set the condition as (“${BearerToken}”)!=”NOT FOUND”
HTTP Request
It is a sampler that lets you send an HTTP/HTTPS request to a web server for load testing
HTTP Request:
* We have to set the parameter in all the HTTP Request
* Set the variable as po number so that po number will be taken from the csv file
HTTP Header Manager
Http headers that are sent to the server from the browser in use for scenario recording
After setting the Regular expression exactor we have to set the bearer Token as Authorization ${BearerToken} inside each and every API
Selecting Po and Confirming
Select Po and Confirm:
* Set the variable name as ${po_number} wherever the po number is mentioned so that each of the po number will be taken from the csv file
- Set the variable name as ${qty} wherever the quantity is mentioned so that each of the quantity will be taken from the csv file
Creating the Shipment
Create ASN(Shipment):
* Set the variable name as ${po_number} wherever the po number is mentioned so that each of the po number will be taken from the csv file
- Set the variable name as ${qty} wherever the quantity is mentioned so that each of the quantity will be taken from the csv file
CSV Data set Config
Under the Test plan we have to add the ==> Config element ==> Csv data set config
In the csv data set Config, we have to add:
- File name: Set the file name with the path
- File encoding: -
- Variable name: email, password, po_number, qty (as we set the email, password, po_number, qty variable which we set on the csv file)
Csv File with Multiple Users
For the Multiple user we have create the csv file and give multiple Users, Password, Po Number, qty
View Results in Tree
Under the Thread group we can
add ==> Listeners=> view results in tree
- To view the results in the tree structure
- Green colour indicates the script run successfully
- Red Colour indicates the script is getting error
- Can view request along with the response parameter
View Results in Table
Under the Thread group we can
add ==> Listeners=> view results in table
To view the results in the table structure
- START TIME — we can see the start time of each user
- THREADNAME — It is nothing but the thread group name which we give
- LABEL — label is nothing but the request name
- SAMPLE TIME — Sample time is nothing but millisecond how much time it takes
- STATUS — Proper response — will indicates the green colour Invalid response indicates — red colour
- BYTES — Amount of data receive ==> response
- SENT BYTES — amount of data sent ==>Request
- LATENCY — time from before sending the request to just after receiving the first part of the response
- CONNECT TIME — time taken to connect to the server
Debug Sampler
Debug Sampler help us to see variables values in the “View Results Tree”
Thank You! :)