Login once - execute business process multiple times - Logout once scenario Jmeter

Scenario : 
We need to execute the below scenario in Jmeter for a duration of 3600 seconds.
1)Login only once
2)Business Process need to run multiple times
3)Logout Only once

Limitation with loop controller:

Some might suggest to use the Loop Controller (i.e) we need to add all the Business Process HTTP  Samplers into loop controller, set the loop count to forever and set the duration to 3600 seconds in Scheduler Configuration (Thread Group setting).

Login HTTP Sampler
Loop controller - Business Process HTTP Sampler
Logout HTTP Sampler

But the drawback in this approach is, Loop counter will execute infinitely till the completion of the duration of the test and logout will not be executed. Hence the sessions will not get terminated and we have to wait till the session timeout. So running back to back tests will be impossible.

Solution:

This can be achieved using Simple and Runtime Controllers

Login - Simple controller 
Runtime controller with business logic set to desired run-time (3600 Seconds)
Logout - Simple controller

In this approach the user will login once and execute the business process repeatedly for the configured duration in the runtime controller and logout once.

This is something similar to Vuser Init (once) - Action (iterate) - Vuser End (once) in loadrunner.






1 comment:

  1. but data is not picking up correctly from csv in loop controller. it always picks up first but I have lot of data in csv.

    ReplyDelete