Hi.. I will be posting all the testing related stuff here. The content posted here is a collection from different websites.

Thursday, June 14, 2012

Introduction to Apache JMeter

Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions. Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.
Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it primarily to test the performance of Apache JServ (a project that has since been replaced by the Apache Tomcat project).
Apache JMeter features include:
  • Can load and performance test many different server types like Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail - POP3(S) and IMAP(S) etc.

  • Complete portability and 100% Java purity .

  • Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.

  • Careful GUI design allows faster operation and more precise timings.

  • Caching and offline analysis/replaying of test results.

  • Highly Extensible:

  • Pluggable Samplers allow unlimited testing capabilities.
  • Several load statistics may be chosen with pluggable timers .
    • Data analysis and visualization plugins allow great extensibility as well as personalization.
    • Functions can be used to provide dynamic input to a test or provide data manipulation.
    • Scriptable Samplers (BeanShell is fully supported; and there is a sampler which supports BSF-compatible languages)
Essential Components of JMeter:
1.Test Plan: The Test Plan is where the overall settings for a test are specified. Static variables can be defined for values that are repeated throughout a test, such as server names. For example the variable SERVER could be defined as www.example.com, and the rest of the test plan could refer to it as ${SERVER}. This simplifies changing the name later.
2.Thread Group: A Thread Group defines a pool of users that will execute a particular test case against your server. In the Thread Group GUI, you can control the number of users simulated (num of threads), the ramp up time (how long it takes to start all the threads), the number of times to perform the test, and optionally, a start and stop time for the test. When using the scheduler, JMeter runs the thread group until either the number of loops is reached or the duration/end-time is reached - whichever occurs first. Note that the condition is only checked between samples; when the end condition is reached, that thread will stop. JMeter does not interrupt samplers which are waiting for a response, so the end time may be delayed arbitrarily.
3.WorkBench: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. Your WorkBench can be saved independently, if you like (right-click on WorkBench and choose Save).
Certain test elements are only available on the WorkBench:
  • HTTP Proxy Server
  • HTTP Mirror Server
  • Property Display
4.Samplers: Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.
Various types of samples are listed below:
  • FTP Request
  • HTTP Request
  • JDBC Request
  • Java Request
  • SOAP/XML-RPC Request
  • WebService(SOAP) Request
  • LDAP Request
  • LDAP Extended Request
  • Access Log Sampler
  • BeanShell Sampler
  • BSF Sampler
  • JSR223 Sampler
  • TCP Sampler
  • JMS Publisher
  • JMS Subscriber
  • JMS Point-to-Point
  • JUnit Request
  • Mail Reader Sampler
  • Test Action
  • SMTP Sampler
5. Logic Controllers: Logic Controllers determine the order in which Samplers are processed.
Various types of Logic Controllers are listed below:
  • Simple Controller
  • Loop Controller
  • Once Only Controller
  • Interleave Controller
  • Random Controller
  • Random Order Controller
  • Throughput Controller
  • Runtime Controller
  • If Controller
  • While Controller
  • Switch Controller
  • ForEach Controller
  • Module Controller
  • Include Controller
  • Transaction Controller
  • Recording Controller
6. Listeners: These are means to view, save, and read saved test results. Listeners are processed at the end of the scope in which they are found. The saving and reading of test results is generic. The various listeners have a panel whereby one can specify the file to which the results will be written. By default, the results are stored as XML files, typically with a ".jtl" extension. Results can be read from XML or CSV format files.
Various types of Listeners are listed below:
  • Sample Result Save Configuration
  • Graph Full Results
  • Graph Results
  • Spline Visualizer
  • Assertion Results
  • View Results Tree
  • Aggregate Report
  • View Results in Table
  • Simple Data Writer
  • Monitor Results
  • Distribution Graph (alpha)
  • Aggregate Graph
  • Mailer Visualizer
  • BeanShell Listener
  • Summary Report
  • Save Responses to a file
  • BSF Listener
  • JSR223 Listener
  • Generate Summary Results
  • Comparison Assertion Visualizer
7. Configuration Elements: Configuration elements can be used to set up defaults and variables for later use by samplers. Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope.
Various types of Configuration Elements are listed below:
  • CSV Data Set Config
  • FTP Request Defaults
  • HTTP Authorization Manager
  • HTTP Cache Manager
  • HTTP Cookie Manager
  • HTTP Request Defaults
  • HTTP Header Manager
  • Java Request Defaults
  • JDBC Connection Configuration
  • Keystore Configuration
  • Login Config Element
  • LDAP Request Defaults
  • LDAP Extended Request Defaults
  • TCP Sampler Config
  • User Defined Variables
  • Random Variable
  • Counter
  • Simple Config Element
References
  1. http://jmeter.apache.org/usermanual/index.html

No comments: