Saturday, 8 August 2015

JMeter : Test Plan components

A Test plan defines what to test and how to test. A test plan includes following elements.
         Thread Groups
         Timers
         Assertions
         Listeners
         Test Fragment
         Configuration Element
         Pre processors
         Post processors
         Assertions

1. Thread Groups
Thread groups are the beginning points of any test plan. All controllers and samplers are under thread group. Thread group controls the number of threads JMeter will use to execute your test.

In a thread group, you can configure
         The number of threads
         The ramp-up period
         The number of times to execute the test

If number of threads are 10, and ramp-up period is 100 seconds, then JMeter takes 100 seconds to get all 10 threads create and running, like thread1 start functioning at 10th second, thread2 start functioning at 20th second, Thread3 starts functioning at 30th, Thread4 start functioning at 40th and so on (ramp-up time/Number Of threads = 100/10 = 10 seconds).

2. Controllers
JMeter has two types of controllers
a.   Samplers
b.   Logical Controllers

2. a. Samplers
Samplers tell JMeter send a request to a server.  JMeter provides number of samplers to send requests. To send HTTP request, you can use HTTP sampler, to send FTP request, you can use FTP sampler. Some of the samplers supported by JMeter are FTP, HTTP, JDBC, Java object request, LDAP, SOAP/XML-RPC Request, WebService (SOAP) Request.

2. b. Logical Controllers
Logic controllers determine the order in which the samplers are processed.

3. Listeners
Listeners are used to post-process the request and response data. JMeter provides number of listeners to view the results in html, xml, graph formats and aggregate the results etc., By using listeners you can redirect the results to a file for future use.

4. Timers
By default JMeter sends request to the server without any delay.  By using Timers, you can add delay to the samplers. If more than one timer are added to a thread group, then the sum of the timers and delays for that amount of time are apply before executing the samplers to which the timers apply.

5. Assertions
By using assertions, you can test the response data. You can add assertion to any sampler. To view the assertion results, add an Assertion Listener to the Thread Group.

6. Configuration Elements
Configuration elements are used to modify the requests.

7. Pre-processor Elements
A pre-processor executes before the sampler request sent to server.

8. Post-processor Elements
Post-processor executes after sampler request made.

The execution order like following
1.   Configuration elements
2.   Pre-Processors
3.   Timers
4.   Sampler
5.   Post-Processors
6.   Assertions
7.   Listeners

Note
Logic Controllers and Samplers are processed in the order in which they appear in the tree.



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment