24
Basics - jMeter jMeter is an Open Source testing software. It is 100% pure Java application for load and performance testing.

Basic of jMeter

  • Upload
    shub

  • View
    2.074

  • Download
    0

Embed Size (px)

DESCRIPTION

What is jMeter, About Performance testing of application

Citation preview

Page 1: Basic of jMeter

Basics - jMeter

jMeter is an Open Source testing software. It is 100% pure Java application for load and performance testing.

Page 2: Basic of jMeter

Basics - jMeter

– Shubelal Kumar

Page 3: Basic of jMeter

− What is jMeter?− Why jMeter?− How jMeter Works? − Test Plan − Thread Group − HTTP Request Sampler − jMeter Useful Resources

Topics

Basics - jMeter

Page 4: Basic of jMeter

− JMeter is a software allowing to load test or performance oriented business (functional) test on different protocols or technologies. Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it primarily to test the performance of Apache JServ (Now called as Apache Tomcat project). Apache later redesigned JMeter to enhance the GUI and to add functional-testing capabilities.

The protocols supported by jMeter are:

− Web: HTTP, HTTPS sites 'web 1.0' web 2.0 (ajax, flex and flex-ws-amf)− Web Services: SOAP / XML-RPC− Database via JDBC drivers− Directory: LDAP− Messaging Oriented service via JMS− Service: POP3, IMAP, SMTP− FTP Service

What is jMeter?

Page 5: Basic of jMeter

− Its free. Its an open source software.− It has simple and intuitive GUI.− JMeter can load and performance test many different server types: Web - HTTP, HTTPS, SOAP,

Database via JDBC, LDAP, JMS, Mail - POP3− It is platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on JMeter shell script.

On Windows it can be invoked by starting the jmeter.bat file.− It has full Swing and lightweight component support (precompiled JAR uses packages javax.swing.* ).− JMeter store its test plans in XML format. This means you can generate a test plan using a text editor.− It's full multi-threading framework allows concurrent sampling by many threads and simultaneous

sampling of different functions by separate thread groups.− It is highly Extensible.− Can also be used to perform automated and functional testing of your application.

Why jMeter?

Page 6: Basic of jMeter

− jMeter simulates a group of users sending requests to a target server, and return statistics that show the performance/functionality of the target server / application via tables, graphs etc. The figure below depicts this process:

How jMeter Works?

Page 7: Basic of jMeter

How JMeter Works

Page 8: Basic of jMeter

Test Plan : Only one test plan can be added per script. Saved for future use.

Thread Group: Represents one set of actions. Added under Test Plan and can simulate Multiple users with same set of actions.

HTTP Request Sampler : Records requests to web server and receives response.

Terminology

Page 9: Basic of jMeter

Samplers

Page 10: Basic of jMeter

− Name: we will change the name to reflect the action what we want to achieve− This will will name “Visit Google Home Page”

− Server Name or IP: here we have to type the web server name− In out case it is http://www.google.com− Note http:// part is not written this is only the name of the server or its IP

− Protocol: we will keep this blank− That will mean we want HTTP as the protocol

− Path: we will type path as / (slash)− This means we want the root page of the server− This also means now the server will decide what page will be sent to us and it is the default page of

the web site

HTTP Request Sampler

Page 11: Basic of jMeter

− Listeners are used to view the results in the form of graph, tree, numbers

− View Results Tree: Shows data for each item with details. Request, Response and Transaction status can be fetched through this listener

− Summary Report: Entire Performance information, Simulated users and details in numbers for each user.

Listeners

Page 12: Basic of jMeter

View Results Tree

Page 13: Basic of jMeter

Summary Report

Page 14: Basic of jMeter

− Samples: A sample mean one sampler call.  One request to web page in our case.  It is web page requests to the page http://www.google.com made by Jmeter

− Average: This value is the average time taken to receive the web pages.

− Min and Max: These are the minimum and maximum value of time required for receiving the web page.

− Std. Dev:  This shows how many exceptional cases were found which were deviating from the average value of the receiving time.   The lesser this value more consistent the time pattern is assumed.

− Error %: This value indicated the percentage of error.

Summary Report – Continued…

Page 15: Basic of jMeter

− The WorkBench simply provides a place to temporarily store test elements while not in use, for copy/paste purposes, or any other purpose you desire. When you save your test plan, WorkBench items are not saved with it.

− Include / Exclude Patterns on Proxy Server using the pattern “.*\.html” , GIF, JPG, etc

− Set Target Controller where your script needs to be saved

Work Bench & HTTP Proxy Server

Page 16: Basic of jMeter

− Assertions are used to perform additional checks on samplers, and are processed after every sampler in the same scope. To ensure that an Assertion is applied only to a particular sampler, add it as a child of the sampler.

− The response assertion control panel lets you add pattern strings to be compared against various fields of the response. The pattern strings are:

Contains, Matches,Equals, Substring

Assertions

Page 17: Basic of jMeter

Response Assertion

Page 18: Basic of jMeter

− CSV Data Set Config is used to read lines from a file, and split them into variables. − When you need to check for multiple logins this feature can be used.

Parameterization

Page 19: Basic of jMeter

− There are various timers that can be used in Jmeter.− The most commonly used timer is the constant timer.− If you want to have each thread pause for the same amount of time between requests, use this timer.

Timers

Page 20: Basic of jMeter

− Once all of the above steps are done, run your script.

How to Run a script

Page 21: Basic of jMeter

− Add a Test Plan -> Thread Group

− Add HTTP Proxy Server on WorkBench to include/exclude patterns

− Add Listeners (View Results Tree, Summary Report), Assertions, timers if required

− Start Proxy Server and do settings on Browser

− Open the URL and record the script

− Once done, stop the script

− Save your test plan

− Run the test plan and view results

Basic Requirements to Run a script

Page 22: Basic of jMeter

jMeter

− http://www.tutorialspoint.com/jmeter/jmeter_overview.htm

− http://jmeter.apache.org/usermanual/build-web-test-plan.html

− https://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.pdf

− http://blazemeter.com/blog/jmeter-tutorial-video-series

Reference

Page 23: Basic of jMeter

Questions??

? ??

??

? ???

Page 24: Basic of jMeter

Thank you