JMeter Documentation ?
JMeter Documentation ?
What is JMeter? JMeter is a performance testing tool used for testing the web-based application and Mobile based
applications to check the overall performance of the application by applying the number of loads i.e., users.
What is the use of JMeter? JMeter is basically used to apply the load on various phases like-
Load Testing - within the requirement (As per the load ex-100 users=100 users)
Stress Testing - Against the requirement (beyond) ex-100 users = 500 users
Volume Testing - Transferring a huge amount of data.
Soak Testing - Transfer huge data within a specific period of a time.
Advantages of JMeter:
Open-source tool
GUI user-friendly (Graphical user interface)
Execution Result-Multiple Formats
JMeter elements? Examples? The elements available in the JMeter tool are known as JMeter elements.
How to create your first JMeter Test case execution? what all pre-requisites we must follow:
Open JMeter
Test plan
Thread group
Samplers Listeners save the plan and Execute the Test plan- once at a time [Execute]
What is the Thread group? - Number of users we must define here lest say from 0-1000 to user need.
Types of samplers-
What are Listeners? output results/report generate for analysis the performance response.
Types of Listeners-
What are Timers? Types of timers available? Which do we use the most? Timers are the time for the sampler-
request to perform when and how at what time. Also, we do have multiple Timers.
1sec = 1000ms
1min =60sec
1hr = 60min
24hrs =1440min
What is correlation? The relation between two samplers is known as co-relation. Example- Request1- will get some
response data - from that response, we must fetch the data (which we required) and store it into a variable and pass
it into the second Request2.
What is the difference between constant and uniform Random timers? (Difference usage)?
Example- 1000/2000/5000
1sec= 1000ms
If the request is fetched under 1000 ms then it will not go for 5000
Doubts/concerns on JMeter?
Execution result- No. of users 1-1/No. of users, 1-2 under thread name what is this?
Sampler = 1(Request)
User =2
1byte - 8bits
Latency - internet connections.
sent bytes - how many bits sent have been done for the request.
connect time - How much time does it take to connect to the server.
Hits- per sec -How much time it took to fetch a request on a basis of seconds.
Example-(output)
Load time:1889
Connect Time:0
Latency:1889
Size in bytes:712
Sent bytes:1557
Sample Count:1
Error Count:0
Response code:200
Response message:OK
HTTPSampleResult fields:
ContentType: application/json
DataEncoding: null
JMeter does not support multiple test plans for a single window. (Limitation)
5. Creating a test case with a regular expression extractor for multiple formats of listeners?
Assertions- types of assertions? Assertion means simply verifying the data fetched by the server for a particular
request. For example- response code//response message//size//duration
Types of assertions-
Response assertion
Duration assertion
Size assertion
Html assertion
XML assertion
X-path assertion
JSON assertion
XML-schema assertion
Logic Controllers in JMeter? The work is to control the samplers [In order to set how to execute and when to achieve
the requests]
To handle multiple requests for multiple operations, we must follow this sequence.
write a test case for a single request executed 10times where others request by default?
Doubts/concerns on JMeter?
Can we perform a single request or multiple requests? can we perform multiple requests in JMeter? Yes, we can
create and follow multiple [no. of request]
Follow redirect [option present in the sampler] as a ticked that's why we are getting it.
Depending upon the request/URL it will take some time to execute the response. [varies]
Simple controller- a container that stores multiple requests in it[depending upon the requirement]
If we want to execute requests multiple times we go for this controller (child to parent calling).
A test fragment controller is almost the same as a simple controller [which stores multiple samplers]
What is the included controller? and the uses? Same as module controller operation. creating a test case with a
simple module and Test fragment, including a controller with execution result? -[Execution workflow not worked
correctly]
Random controller - This will execute only one request at a time [i.e., dynamically]
Random order controller - This will execute all the requests, but it should be dynamic [on each execution]
creating a test case with Random and Random order controllers with execution results.
practical exercises.
This controller will follow and execute the first request only (For multiple requests if there it will select only the first
request)
Depending upon the user- The user should carry forward with the percentage.
5users = 50%
Why do we use a throughput controller? Advantages? To ignore thread groups for huge/complex scripting.
GET Request - Get method is used to select/fetch the data from a database server.
POST Request -To create a new set of data on the database server by applying some.
PUT Request - To update the data present inside the database server.
DELETE Request - If want to delete a new data/existing data available on the database server. (Is to remove the data
permanently)
Request//Response-
What is the request?
A client sends a request to fetch some data from the database server.
Example- If a client wants to open a Flipkart application.
Then he/she must open the browser.
Type the domain name and URL.
Search for it- front end application will open (Flipkart).
So, the application will open using a database server. [That was hit by the users]
In short - A user request = response data.
steps to follow:
1. Go to view results tree format Report-
Go to response data- Response body- select the proper attribute name with the attribute value. (Whichever we
need)
Example- "msisdn":"666777822222625",
2. copy the selected element and paste it into the search bar- with case sensitive and regular expressions (Ticked)
3. click the find button- it will show the element with green highlighted below the response body.
4. Then follow the proper syntax for dynamic element fetching- By using (.*?)
example- "msisdn":"(.*?)",
(By default, the format will be in - text)
Note:
we can also do the same operation on this site- https://regexr.com/
Connecting time-
How much time does it take to connect to the server [following multiple activities]
Recording controller-
If we want to record a scenario based on the requirement and user needs.
At that stage we will use JMeter for recording or else we can also use Blaze Meter,
a bad boy Tool (Performance testing tool).
Note:
On the developer Tool, we have Headers Tab- (under the Network Tab)
Example URL- https://www.google.com/
General
Response Header
Request Header
Note:
To access all the plugins in the JMeter Tool, we must use the link.
https://jmeter-plugins.org/wiki/PluginsManager/
Download the jar file and paste it into the ext. folder- JMeter/lib/ext. Paste the jar file.
Internal parameter
Understood all the features available inside the CSV data set config. Element.
(Practically practiced each bit-by-bit operation)
Variables- simply container which stores the data/value inside the variable for further calling/using it into the
samplers.
Functions in Jmeter-
Theory Concept-
Functions-Types[syntax]
${__log("diptidash")}
${__time("dd/mm/yyyy")}
${__intSum(10,20)}
Practical concept-
What are timers and types of timers? How to add think time?
Timers = Time period [Timeout seconds]
Types of timers- [mostly used this timer in real time]
1. constant timer- fixed timer ex-1000/2000/3000 delay time.
2. uniform random timer- Dynamic time.
Steps to follow-
(To upload files with different names to FTP)
Step 1: add CSV Data Set Config
Step 2: Create a CSV file and provide its location in CSV Data Set Config
Step 3: parametrize FTP PUT request to take value from CSV file.
Step 4: Run and Validate
Note:
Regex is easy for creating the expression syntax for the sampler.
Practical screenshots-
2. How to use Templates File - Templates - select a template and start building over it.
templates.xml template
isTestPlan=”true” : template will create a new test plan
isTestPlan=”false” : templat will be merged into existing test plan
name : Name of the template
fileName : location of .jmx file
description : description will be displayed in html
Practical -
How to test file upload?
1. How to create a test for file upload
2. How to record test for file upload
Helping Tips:
In case you face any issues
Check the following:
In case you face any issues in recording the scenario...
Watch:
https://youtu.be/amEHuq8auTU?list=PLh...
References:
http://www.tinyupload.com/
http://www.freeformatter.com/mime-typ…
Helpful Tips:
How to avoid overwriting downloaded files.
in a multi-user test
References:
ftp://speedtest.tele2.net/
Helpful Tips
References:
How to use Plugin Manager:
https://youtu.be/KQfoBOK37ms?list=PLh...
Examples:
(workaround)
we can capture the CSV file by using JMeter 5.4.3V but not able to capture HTML so in -order to do this we can
go for Apache JMeter 5.5 version under the bin folder paste the HTML (folder) and CSV which was taken by JMeter
5.4.3 version on executing.
Point to remember always run all these commands only in- (bin directory)
Example-
C:\Users\xyz\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin>
THE END