Welcome To User Friendly Software Technical concepts

This Blog contains information of various technical concepts,The concepts are precise,informative with examples.visitors can easily understand the concepts of different technical related subjects like software Testing concepts , practice questions on sql And JMeter(Open source automation tool ) for Performance testing of an web application and about selenium tool used for functional testing of an web application

Tuesday, September 7, 2010

Basic Types of controllers in JMeter


 Controllers in JMeter:
JMeter has two types of Controllers: Samplers and Logical Controllers
Samplers tell JMeter to send requests to a server. For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request
Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
Logical Controllers:
Logic Controllers determine the order in which Samplers are processed.
1) Once only controller  
 Once Only Logic Controller tells JMeter to process the controller(s) inside it only once.

This Controller is used for the login request that has to be send to the server only once.
So that Login request should be placed under this controller.

Consider there will be two Requests in Test plan ie is Request1 and Request2 such
that one request will be a login request placed under once only controller.So that
JMeter will execute these request such that

Login(Request1)
Request2
Request2 for Loop count :2

This is as like to be a  real time scenerio



Example: No of threads=1
                 Ramp up period=1
                 Loop count=3





In the above screen shot he HTTP Request ‘b’ is executing only once as it is under once only controller. Whereas ‘a’ is executing thrice because loop count is 3.
2) Loop controller
If you add Generative or Logic Controllers to a Loop Controller, JMeter will loop through them a certain number of times, in addition to the loop value you specified for the Thread Group.
For example, if you add one HTTP Request to a Loop Controller with a loop count of two, and configure the Thread Group loop count to three, JMeter will send a total of 2 * 3 = 6 HTTP Requests.


In the above screen shot the http request ‘b’is repeating 9 times(Loop Controller with a loop count of three and configure the Thread Group loop count to three)

If you add Generative or Logic Controllers to an Interleave Controller, JMeter will alternate among each of the other controllers for each loop iteration.

Random Controller

The Random Logic Controller acts similarly to the Interleave Controller, except that instead of going in order through its sub-controllers and samplers, it picks one at random at each pass

 

 

5) Simple Controller
The Simple Logic Controller lets you organize your Samplers and other Logic Controllers. Unlike other Logic Controllers, this controller provides no functionality beyond that of a storage device.


6)Transaction Controller
 
 The Transaction Controller generates an additional sample which measures
the overall time taken to  perform the nested test elements.

 For example :

 In JMeter when record is done through proxy server so many tiny elements will be
 be generated for each page rather than request for entire page. So that,its difficult to
 analyze the test results.To group all the tiny compnents of the page ,
 a Transaction Controller  has to be used.

Transaction Controller will show results for all request rather than the each component.

Please follow the steps to achieve this

1)Add thread group

2)Add Transaction Controller  to the thread group
    (Thread group->Logic controllers ->Transaction Controller).

3)Check the  generate parent sample check box in Transaction Controller page..

4)Now view the listeners.


No comments:

Post a Comment

You Can Post Your Comment Here