Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Load Testing Using JMeter

Sridhar
BIT Mesra
What is Jmeter?
Load Testing
Tools to perform LoadTesting
• Jmeter
• Loadview
• WebLoad
• LoadUI
• NeoLoad
Advantages
• UserFriendly
• OpenSource
• Support
• Reporting
• Documentation
• Recoding
Elements of JMeter
• Thread Group
• Samplers
• Listeners
• Configuration
• Assertions
Samplers
• FTP Request
• HTTP Request
• JDBC request
• BSF Sampler(Beanshell Sampler)
• Access log sampler
• SMTP Sampler
Configuration
• CSV Data set config
• HTTP Cookie Manager
• Login config element
• HTTP request Defaults
• FTP Request Defaults
Assertions(Assertion in JMeter is used
to validate response of the request)
Dashboard(Apdex numerically scores the level of satisfaction of an end user
based on application responsiveness by calculating the degree to which user
expectations compare to performance in a fractional 0 (no users satisfied) to
1 (all users satisfied) scale.)
Installation
• Check for Java (java –version)
www.apache-jmeter.org

• Extract,in the folder(downloads),in bin, run


the jmeter.bat file
First Screen
Create Test Plan(container contains
elements of test)
(right click Test plan)Create Thread Group
Right click on Thread Group and add
sampler like HTTP request
Right click on Http request and add Listener like View
results in Table and click run green arrow head in tool
bar(save file.jmx) and click view results in table
Jmeter Part-2
Recording scripts
Demo steps
• Create Test Plan
• Create Thread group
• Create Sampler(Http request)
• Right Click on the test plan than click non-test
Elements and then select Http test script
recorder.
• Add some port no like 8181
• Right click thread group than logic controller than
select recording controller.
• Create three (for ex.)recording controllers.
Making Jmeter as Proxy
• Go to the settings by first clicking options of
the Firefox browser.Then Network settings,
• Add the certificate –Apache JmeterTemp
rootCA from bin to browser view certificate
location
Set port no to any like 8181,select the the controller(ex admission)
save and click start
open browser and go to the site and select admission,examination
than stop,view results
• If the recording is not done than do the
following:
• 1)Download Badboy software
• 2)Download Blazemeter(plugin to chrome)
• Let us do the first 1)
Front end
Type any url in the url bar ,say-www.amazon.in
Enter, it will record the actions performed on the page
• Export this file to Jmeter with some file
name.jmx.
• Now open Jmeter,and open the file .You will
find all the recordings.
• Change some configuration in thread Group
also add listener than start and she the
results.
Jmeter screen after getting the script
from badboy
Recording using Blazemeter
• Create an ACCOUNT in blazemeter.com
• Than get the blazemeter plugin by searching
in google (install blazemeter plugin) in
chrome browser,than click add to chrome.
Recording script
• Open chrome and click on the blazemeter
icon.sign up to blazemeter account.
• Now type any url in the url bar
like,www.amazon.com.and what ever the
actions that you do will be recorded and than
click on stop recording.
• Save the file with .jmx .It
Will be saved in download
folder.
Open Jmeter and open the
Saved file
Jmeter Assertions(checks on response)
• Create Test Plan(Ex assertionDemo)
• Create Thread Group(Ex.Users)also add Sampler Http request
• Add Listeners
• Right click Test Plan than add assertion select response
assertion.
• In Response assertion do the following:
Apply to---select Main Sample only
Failed to test…Response code
Pattern Matching Rules.....equals
Type pattern…200
Start the test
Test Passed(green)
Change the response code to 201
test failed (red)
See response assertion
Add listener-assertion listener
Add duration assertion and size
assertion
• Add some duration assertion .ex.1000ms
• And check the assertion results.
• Add some size assertion and check the results
• Try for HTML assertion also(give thresholds
also list the html errors in the.csv file by
clicking the browse button and saving
log/errors in the file)also check for xml and
xhtml. Check for xml /xpath assertions also

You might also like