SlideShare a Scribd company logo
1 of 40
Introduction to JMeter
By Ranil Weerasinghe
&
Tharinda Liyanage
What will be covered…
• 1st Phase
• Getting to know about the tool
• Types of Applications/protocols
• Features
• Installation and configuration
• Components
• Strengths and Weaknesses
• 2nd phase
• Practical session with examples
What is JMeter
• Performance testing tool (like LoadRunner, WebLoad, OpenSTA , etc)
• It supports performance testing of:
• Web application
• Web services (SOAP and REST)
• Database query performance
• Mail - SMTP(S), POP3(S) and IMAP(S)
• JMS
• Mobile
• Apache Project - http://jmeter.apache.org/
• 100% pure Java desktop application
• Originally developed by Stefano Mazzocchi
Features of JMeter
• Load and performance test various protocols
- HTTP(S), FTP, JDBC, JMS, LDAP, SOAP
•HTTP proxy server for recording test scripts – eliminates 3rd party recording tools like
“Badboy”
•Platform Independent
•Execution can do in batch mode and analyze offline.
•Distributed testing.
•Extensible. – Plugins (https://code.google.com/p/jmeter-plugins/)
Test Architecture
Strengths
• Free and open source
• Active development/ community
• Extensibility
• Capability of dynamic scripting/ generate load/ and reporting
• Supports automation (Maven with Jenkins CI for performance testing in regression
mode)
• Cloud compatibility
Weaknesses
• Memory management issues
But …adjust Heap memory/ use 64-bit version/ run non-GUI mode
• Reports are a bit lacking
But... Plugins provides many
• Steep learning curve
Lack of Training opportunities and require technical skills
• Limited Support
No dedicated support like commercial tools
Setting Up and Running JMeter
• The latest version of JMeter can be downloaded from the project website:
http://jmeter.apache.org/download_jmeter.cgi
• JMeter requires a fully compliant JVM 1.6 or higher.
 You need Java, with the JAVA_HOME environment variable set.
• To install a release build, simply unzip the zip/tar file into the directory where you
want JMeter to be installed.
• To run JMeter, run the jmeter.bat (for Windows)
• or jmeter.sh (for Unix) file.
JMeter Elements
• Test Plan: where the overall settings for a test are specified.
• Thread groups: defines a pool of users that will execute a particular test case
against your server.
• Samplers: sends requests to a server
• Logical controllers : control flow of test plan (loops, conditionals, ordering, etc.)
• Listeners: record, summarize and display record and response data
• Timers: introduce delays in test plan
• Assertions: assert facts about responses, for functional testing
• Configuration elements: Configuration Elements set default values for other parts
of the Test Plan as well as configure variables.
• Pre-processors and post-processors
• Workbench :It provides a place to temporarily store test elements while
not in use for copy/paste purposes
• JMeter Proxy Server : watch and record your actions while you browse your web
application with your normal browser
Test plan
• Where the overall settings for a test are specified.
Thread group
• Thread group elements are the beginning points of any test plan.
• It controls the number of threads JMeter will use to execute your test
Samplers
• Samplers tell JMeter to send requests to a server and wait for a response.
• Processed in the order they appear in the tree.
• Controllers can be used to modify the number of repetitions of a sampler.
•HTTP Request
• JDBC Request
• Java object request
• LDAP Request
• SOAP/XML-RPC Request
•FTP Request
Logical controllers
• Loop Controller
• If controller
• Transaction Controller
• Recording Controller
Logic Controllers determine the order in which Samplers are processed
Some controller are:
Listeners
• “Listen" to the test results.
• View, save, and read saved test results
• Can be saved to JTL, CSV or XML format.
• Listeners can be added anywhere in the test, including directly under the
test plan.
Listeners
Timers
• Add delay to script
• If not, overwhelms your server
• Ex:
• Constant timer
• Random timer
• Synchronizing timer
Assertions
• Verify correctness of your response.
• Ex:
• Response assertion – Verify fields of response
• Size assertion - tests that each response contains the right
number of bytes in it
• Duration assertion- tests response received within a given
amount of time
Functions & Variables
• Variables – to parameterized
•JMeter variables are local to each thread.
•Referenced as ${VARIABLE}
•Functions
•Are special values that can populate fields of any Sampler or other
element in a test tree
${__FunctionName()}
• Types
•Information
•Ex: ${__log()}
•Input
•Ex: ${__StringFromFile()}
•Calculations
•Ex: ${__RandomString()}
Demo
1. Adding a Thread Group
Test Plan -> Thread Group
– Number of thread
– Ramp-up Period
– Loop count
2. Adding a HTTP Request Defaults
Test Plan -> Thread Group -> HTTP Request Defaults (HTTP Request Defaults saves you time when
doing lots of HTTP Samplers)
– Protocol – enter “HTTP”
– Server name – enter “jakarta.apache.org”
– Path – leave blank
– Port number – enter “80”
How to Build a Test Plan
How to Build a Test Plan Cont..
3. Adding a HTTP Proxy Server
Workbench -> HTTP Proxy Server
– Port field - Enter “9090”
– Target Controller – click on the drop down and select “test plan > thread group”
– Click the “add” button in “Patterns to include”.
– This will create a blank entry. Enter “.*.html”
– Click the “add” button in “Patterns to exclude”.
– This will create a blank entry. Enter “.*.gif”
– Click the “start” button at the bottom
4. Setting a Proxy in IE
– Start Internet Explorer, but do not close Jmeter.
– From the tool bar, click “tools -> internet options”.
– Select the “connection” tab
– Click “LAN settings” button
– On the connections tab, check “Use a proxy server for
your LAN”.
How to Build a Test Plan Cont..
– Address – enter “Localhost” or the IP address of your system
– Port – enter “9090”.
– Click “ok” button
– Click “ok” button again. This should return you to the browser
– In the “Address” bar at the top, enter
“http://jakarta.apache.org/jmeter/index.html” and hit the “enter” key.
– Click on a few links on Jmeter's page.
– Close internet explorer and bring up the JMeter window.
5. Adding a Listeners
Test Plan -> Thread Group -> Listeners
– Graph Results
– View Results in table
– View Results in tree
– Aggregate report
How to Build a Test Plan Cont..
6. Adding a Cookie Manager
Test Plan -> Thread Group -> HTTP Cookie Manager
Many Web applications use cookies. JMeter provides cookie capabilities through a
Cookie Manager. Adding this element to a thread group allows you to send cookies to
the application being tested, just as Web browsers do.
Creating a Load Test Scenario and Execution
JMeter Performance Test Results- View
Results Tree
JMeter Performance Test Results- Summary
Report
Assertions
• Assertions allow you to assert facts about responses received from the server being
tested. Using an assertion, you can essentially "test" that your application is returning
the results you expect it to.
Parameterization – User Define Variables
• Thread Group -> Config Element -> User Define Variables
Parameterization – CSV Data Set Config
• Thread Group -> Config Element -> CSV Data Set Config
Parameterization – CSV Data Set Config
Session Handling
Session Handling Cont..
Session Handling Cont..
• Thread Group -> Post-Processors -> Regular Expression Extractor
Session Handling Cont..
Regular Expressions
* - Matches 0 or more time
+ - Matches 1 or more time
.(dot) – match any character
? – stop when first match succeeds
( and ) – these enclose the portion of the
match string to be returned
More Regular Expressions
http://jakarta.apache.org/oro/api/org/
apache/oro/text/regex/package-
summary.html
Session Handling Cont..
Session Handling Cont..
JMeter Best Practices
 Use non-GUI mode: jmeter -n -t test.jmx -l test.jtl
 Use as few Listeners as possible; if using the -l flag as above they can all be
deleted or disabled.
 Don't use "View Results Tree" or "View Results in Table" listeners during the
load test, use them only during scripting phase to debug your scripts.
 Rather than using lots of similar samplers, use the same sampler in a loop,
and use variables (CSV Data Set) to vary the sample. Or perhaps use the
Access Log Sampler. [The Include Controller does not help here, as it adds
all the test elements in the file to the test plan.]
JMeter Best Practices Cont..
 Don't use functional mode
 Use CSV output rather than XML
 Only save the data that you need
 Use as few Assertions as possible
JMeter Distributed Testing
- Pre conditions
• The firewalls on the systems are turned off.
• All the clients are on the same subnet.
• The server is in the same subnet, if 192.x.x.x or 10.x.x.x ip addresses are used. If the
server
doesn't use 192 or 10 ip address, there shouldn't be any problems.
• Make sure jmeter can access the server.
• Make sure you use the same version of Jmeter on all the systems. Mixing versions may
not work correctly.
• Following image Illustrate the way, how the JMeter Master / Slave configuration works
"Introduction to JMeter" @ CPTM 3rd Session

More Related Content

What's hot

Perfromane Test Tool jmeter
Perfromane Test Tool jmeterPerfromane Test Tool jmeter
Perfromane Test Tool jmeterNaga Mallala
 
Introduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeIntroduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeBugRaptors
 
Performance Testing using Jmeter and Capacity Testing
Performance Testing using Jmeter and Capacity TestingPerformance Testing using Jmeter and Capacity Testing
Performance Testing using Jmeter and Capacity TestingAkshay Patole
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter Knoldus Inc.
 
JMeter Post-Processors
JMeter Post-ProcessorsJMeter Post-Processors
JMeter Post-ProcessorsLoadium
 
Load Testing with JMeter
Load Testing with JMeterLoad Testing with JMeter
Load Testing with JMeterYuriy Gerasimov
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Load Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSLoad Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSVladimir Ilic
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With JmeterAdam Goucher
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeterRachappa Bandi
 
Performance testing and_reporting_with_j_meter by Le Van Nghi
Performance testing and_reporting_with_j_meter by  Le Van NghiPerformance testing and_reporting_with_j_meter by  Le Van Nghi
Performance testing and_reporting_with_j_meter by Le Van NghieXo Platform
 
Perofrmance testing and apache jmeter
Perofrmance testing and apache jmeterPerofrmance testing and apache jmeter
Perofrmance testing and apache jmeterlethibichhoa
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeterGalih Lasahido
 
Using JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingUsing JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingXBOSoft
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeterMikael Kundert
 

What's hot (20)

Perfromane Test Tool jmeter
Perfromane Test Tool jmeterPerfromane Test Tool jmeter
Perfromane Test Tool jmeter
 
Introduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeIntroduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-Time
 
Jmeter From Scratch
Jmeter From ScratchJmeter From Scratch
Jmeter From Scratch
 
Performance Testing using Jmeter and Capacity Testing
Performance Testing using Jmeter and Capacity TestingPerformance Testing using Jmeter and Capacity Testing
Performance Testing using Jmeter and Capacity Testing
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter
 
Jmeter
JmeterJmeter
Jmeter
 
JMeter workshop
JMeter workshopJMeter workshop
JMeter workshop
 
JMeter Post-Processors
JMeter Post-ProcessorsJMeter Post-Processors
JMeter Post-Processors
 
Load Testing with JMeter
Load Testing with JMeterLoad Testing with JMeter
Load Testing with JMeter
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
Jmeter introduction
Jmeter introductionJmeter introduction
Jmeter introduction
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
Load Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSLoad Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWS
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeter
 
Performance testing and_reporting_with_j_meter by Le Van Nghi
Performance testing and_reporting_with_j_meter by  Le Van NghiPerformance testing and_reporting_with_j_meter by  Le Van Nghi
Performance testing and_reporting_with_j_meter by Le Van Nghi
 
Perofrmance testing and apache jmeter
Perofrmance testing and apache jmeterPerofrmance testing and apache jmeter
Perofrmance testing and apache jmeter
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
 
Using JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingUsing JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance Testing
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeter
 

Viewers also liked

Introduction to Jmeter
Introduction to JmeterIntroduction to Jmeter
Introduction to JmeterGuru99
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeterRahul Sudame
 
How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in JmeterViviana Lesmes
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance TestingAtul Pant
 
BlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal MeetupBlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal MeetupBlazeMeter
 
Apachejmeterabriefintroduction
ApachejmeterabriefintroductionApachejmeterabriefintroduction
ApachejmeterabriefintroductionForedoomed
 
Apache JMeter Introduction
Apache JMeter IntroductionApache JMeter Introduction
Apache JMeter IntroductionSøren Lund
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
Apache JMeter - A Brief Introduction
Apache JMeter - A Brief IntroductionApache JMeter - A Brief Introduction
Apache JMeter - A Brief Introductionagilitator
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterAlon Girmonsky
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introductionsilenceIT Inc.
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1Sun Technlogies
 

Viewers also liked (16)

Introduction to Jmeter
Introduction to JmeterIntroduction to Jmeter
Introduction to Jmeter
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
 
How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
BlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal MeetupBlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal Meetup
 
Load testing jmeter
Load testing jmeterLoad testing jmeter
Load testing jmeter
 
Apachejmeterabriefintroduction
ApachejmeterabriefintroductionApachejmeterabriefintroduction
Apachejmeterabriefintroduction
 
Apache JMeter Introduction
Apache JMeter IntroductionApache JMeter Introduction
Apache JMeter Introduction
 
JMeter
JMeterJMeter
JMeter
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
Load testing with J meter
Load testing with J meterLoad testing with J meter
Load testing with J meter
 
Apache JMeter - A Brief Introduction
Apache JMeter - A Brief IntroductionApache JMeter - A Brief Introduction
Apache JMeter - A Brief Introduction
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1
 

Similar to "Introduction to JMeter" @ CPTM 3rd Session

Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
Best Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsBest Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsTesting World
 
Server Performance by Tonny
Server Performance by TonnyServer Performance by Tonny
Server Performance by TonnyAgate Studio
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewSravanthi N
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Nitish Bhardwaj
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonDavid O'Dowd
 
Test talk academy apachejmeter-120521121306-phpapp02
Test talk academy apachejmeter-120521121306-phpapp02Test talk academy apachejmeter-120521121306-phpapp02
Test talk academy apachejmeter-120521121306-phpapp02veeru madduri
 
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to useUma Ghotikar
 
J meter introduction
J meter introductionJ meter introduction
J meter introductionBharath Kumar
 
Jmeter_Presentaion_Parag
Jmeter_Presentaion_ParagJmeter_Presentaion_Parag
Jmeter_Presentaion_ParagPARAG KHEDIKAR
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion isummation
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load TestingAlex Galkin
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02Gopi Raghavendra
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)QA Programmer
 

Similar to "Introduction to JMeter" @ CPTM 3rd Session (20)

Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
Best Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsBest Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working Professionals
 
Server Performance by Tonny
Server Performance by TonnyServer Performance by Tonny
Server Performance by Tonny
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_Overview
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02
 
JMETER-SKILLWISE
JMETER-SKILLWISEJMETER-SKILLWISE
JMETER-SKILLWISE
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
 
Test talk academy apachejmeter-120521121306-phpapp02
Test talk academy apachejmeter-120521121306-phpapp02Test talk academy apachejmeter-120521121306-phpapp02
Test talk academy apachejmeter-120521121306-phpapp02
 
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to use
 
J meter introduction
J meter introductionJ meter introduction
J meter introduction
 
Jmeter_Presentaion_Parag
Jmeter_Presentaion_ParagJmeter_Presentaion_Parag
Jmeter_Presentaion_Parag
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion
 
apache_jmeter.pptx
apache_jmeter.pptxapache_jmeter.pptx
apache_jmeter.pptx
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load Testing
 
JMeter.ppt
JMeter.pptJMeter.ppt
JMeter.ppt
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
 

More from Tharinda Liyanage

Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updatedTharinda Liyanage
 
Useful JMeter functions for scripting
Useful JMeter functions for scriptingUseful JMeter functions for scripting
Useful JMeter functions for scriptingTharinda Liyanage
 
Introduction to Performance Testing
Introduction to Performance TestingIntroduction to Performance Testing
Introduction to Performance TestingTharinda Liyanage
 
Formulating Agile Testing Strategy
Formulating Agile Testing StrategyFormulating Agile Testing Strategy
Formulating Agile Testing StrategyTharinda Liyanage
 
Coded UI: Hand Coding based on Page Object Model
Coded UI: Hand Coding based on Page Object ModelCoded UI: Hand Coding based on Page Object Model
Coded UI: Hand Coding based on Page Object ModelTharinda Liyanage
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testingTharinda Liyanage
 

More from Tharinda Liyanage (8)

Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
 
Qa and Testing
Qa and TestingQa and Testing
Qa and Testing
 
Useful JMeter functions for scripting
Useful JMeter functions for scriptingUseful JMeter functions for scripting
Useful JMeter functions for scripting
 
Introduction to Performance Testing
Introduction to Performance TestingIntroduction to Performance Testing
Introduction to Performance Testing
 
Formulating Agile Testing Strategy
Formulating Agile Testing StrategyFormulating Agile Testing Strategy
Formulating Agile Testing Strategy
 
Coded UI: Hand Coding based on Page Object Model
Coded UI: Hand Coding based on Page Object ModelCoded UI: Hand Coding based on Page Object Model
Coded UI: Hand Coding based on Page Object Model
 
PerfTest in SOA
PerfTest in SOAPerfTest in SOA
PerfTest in SOA
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 

Recently uploaded

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

"Introduction to JMeter" @ CPTM 3rd Session

  • 1. Introduction to JMeter By Ranil Weerasinghe & Tharinda Liyanage
  • 2. What will be covered… • 1st Phase • Getting to know about the tool • Types of Applications/protocols • Features • Installation and configuration • Components • Strengths and Weaknesses • 2nd phase • Practical session with examples
  • 3. What is JMeter • Performance testing tool (like LoadRunner, WebLoad, OpenSTA , etc) • It supports performance testing of: • Web application • Web services (SOAP and REST) • Database query performance • Mail - SMTP(S), POP3(S) and IMAP(S) • JMS • Mobile • Apache Project - http://jmeter.apache.org/ • 100% pure Java desktop application • Originally developed by Stefano Mazzocchi
  • 4. Features of JMeter • Load and performance test various protocols - HTTP(S), FTP, JDBC, JMS, LDAP, SOAP •HTTP proxy server for recording test scripts – eliminates 3rd party recording tools like “Badboy” •Platform Independent •Execution can do in batch mode and analyze offline. •Distributed testing. •Extensible. – Plugins (https://code.google.com/p/jmeter-plugins/)
  • 6. Strengths • Free and open source • Active development/ community • Extensibility • Capability of dynamic scripting/ generate load/ and reporting • Supports automation (Maven with Jenkins CI for performance testing in regression mode) • Cloud compatibility
  • 7. Weaknesses • Memory management issues But …adjust Heap memory/ use 64-bit version/ run non-GUI mode • Reports are a bit lacking But... Plugins provides many • Steep learning curve Lack of Training opportunities and require technical skills • Limited Support No dedicated support like commercial tools
  • 8. Setting Up and Running JMeter • The latest version of JMeter can be downloaded from the project website: http://jmeter.apache.org/download_jmeter.cgi • JMeter requires a fully compliant JVM 1.6 or higher.  You need Java, with the JAVA_HOME environment variable set. • To install a release build, simply unzip the zip/tar file into the directory where you want JMeter to be installed. • To run JMeter, run the jmeter.bat (for Windows) • or jmeter.sh (for Unix) file.
  • 9. JMeter Elements • Test Plan: where the overall settings for a test are specified. • Thread groups: defines a pool of users that will execute a particular test case against your server. • Samplers: sends requests to a server • Logical controllers : control flow of test plan (loops, conditionals, ordering, etc.) • Listeners: record, summarize and display record and response data • Timers: introduce delays in test plan • Assertions: assert facts about responses, for functional testing • Configuration elements: Configuration Elements set default values for other parts of the Test Plan as well as configure variables. • Pre-processors and post-processors • Workbench :It provides a place to temporarily store test elements while not in use for copy/paste purposes • JMeter Proxy Server : watch and record your actions while you browse your web application with your normal browser
  • 10. Test plan • Where the overall settings for a test are specified.
  • 11. Thread group • Thread group elements are the beginning points of any test plan. • It controls the number of threads JMeter will use to execute your test
  • 12. Samplers • Samplers tell JMeter to send requests to a server and wait for a response. • Processed in the order they appear in the tree. • Controllers can be used to modify the number of repetitions of a sampler. •HTTP Request • JDBC Request • Java object request • LDAP Request • SOAP/XML-RPC Request •FTP Request
  • 13. Logical controllers • Loop Controller • If controller • Transaction Controller • Recording Controller Logic Controllers determine the order in which Samplers are processed Some controller are:
  • 14. Listeners • “Listen" to the test results. • View, save, and read saved test results • Can be saved to JTL, CSV or XML format. • Listeners can be added anywhere in the test, including directly under the test plan.
  • 16. Timers • Add delay to script • If not, overwhelms your server • Ex: • Constant timer • Random timer • Synchronizing timer
  • 17. Assertions • Verify correctness of your response. • Ex: • Response assertion – Verify fields of response • Size assertion - tests that each response contains the right number of bytes in it • Duration assertion- tests response received within a given amount of time
  • 18. Functions & Variables • Variables – to parameterized •JMeter variables are local to each thread. •Referenced as ${VARIABLE} •Functions •Are special values that can populate fields of any Sampler or other element in a test tree ${__FunctionName()} • Types •Information •Ex: ${__log()} •Input •Ex: ${__StringFromFile()} •Calculations •Ex: ${__RandomString()}
  • 19. Demo
  • 20. 1. Adding a Thread Group Test Plan -> Thread Group – Number of thread – Ramp-up Period – Loop count 2. Adding a HTTP Request Defaults Test Plan -> Thread Group -> HTTP Request Defaults (HTTP Request Defaults saves you time when doing lots of HTTP Samplers) – Protocol – enter “HTTP” – Server name – enter “jakarta.apache.org” – Path – leave blank – Port number – enter “80” How to Build a Test Plan
  • 21. How to Build a Test Plan Cont.. 3. Adding a HTTP Proxy Server Workbench -> HTTP Proxy Server – Port field - Enter “9090” – Target Controller – click on the drop down and select “test plan > thread group” – Click the “add” button in “Patterns to include”. – This will create a blank entry. Enter “.*.html” – Click the “add” button in “Patterns to exclude”. – This will create a blank entry. Enter “.*.gif” – Click the “start” button at the bottom 4. Setting a Proxy in IE – Start Internet Explorer, but do not close Jmeter. – From the tool bar, click “tools -> internet options”. – Select the “connection” tab – Click “LAN settings” button – On the connections tab, check “Use a proxy server for your LAN”.
  • 22. How to Build a Test Plan Cont.. – Address – enter “Localhost” or the IP address of your system – Port – enter “9090”. – Click “ok” button – Click “ok” button again. This should return you to the browser – In the “Address” bar at the top, enter “http://jakarta.apache.org/jmeter/index.html” and hit the “enter” key. – Click on a few links on Jmeter's page. – Close internet explorer and bring up the JMeter window. 5. Adding a Listeners Test Plan -> Thread Group -> Listeners – Graph Results – View Results in table – View Results in tree – Aggregate report
  • 23. How to Build a Test Plan Cont.. 6. Adding a Cookie Manager Test Plan -> Thread Group -> HTTP Cookie Manager Many Web applications use cookies. JMeter provides cookie capabilities through a Cookie Manager. Adding this element to a thread group allows you to send cookies to the application being tested, just as Web browsers do.
  • 24. Creating a Load Test Scenario and Execution
  • 25. JMeter Performance Test Results- View Results Tree
  • 26. JMeter Performance Test Results- Summary Report
  • 27. Assertions • Assertions allow you to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.
  • 28. Parameterization – User Define Variables • Thread Group -> Config Element -> User Define Variables
  • 29. Parameterization – CSV Data Set Config • Thread Group -> Config Element -> CSV Data Set Config
  • 30. Parameterization – CSV Data Set Config
  • 33. Session Handling Cont.. • Thread Group -> Post-Processors -> Regular Expression Extractor
  • 34. Session Handling Cont.. Regular Expressions * - Matches 0 or more time + - Matches 1 or more time .(dot) – match any character ? – stop when first match succeeds ( and ) – these enclose the portion of the match string to be returned More Regular Expressions http://jakarta.apache.org/oro/api/org/ apache/oro/text/regex/package- summary.html
  • 37. JMeter Best Practices  Use non-GUI mode: jmeter -n -t test.jmx -l test.jtl  Use as few Listeners as possible; if using the -l flag as above they can all be deleted or disabled.  Don't use "View Results Tree" or "View Results in Table" listeners during the load test, use them only during scripting phase to debug your scripts.  Rather than using lots of similar samplers, use the same sampler in a loop, and use variables (CSV Data Set) to vary the sample. Or perhaps use the Access Log Sampler. [The Include Controller does not help here, as it adds all the test elements in the file to the test plan.]
  • 38. JMeter Best Practices Cont..  Don't use functional mode  Use CSV output rather than XML  Only save the data that you need  Use as few Assertions as possible
  • 39. JMeter Distributed Testing - Pre conditions • The firewalls on the systems are turned off. • All the clients are on the same subnet. • The server is in the same subnet, if 192.x.x.x or 10.x.x.x ip addresses are used. If the server doesn't use 192 or 10 ip address, there shouldn't be any problems. • Make sure jmeter can access the server. • Make sure you use the same version of Jmeter on all the systems. Mixing versions may not work correctly. • Following image Illustrate the way, how the JMeter Master / Slave configuration works