Alex Rivera | Logout

JMeter - Why once only controller runs more than once

Asked 2011-01-21T05:55:00.950
17

I added two request one for login to store the session id and another request to check the load test which requires session id.

I made login request as once only, by adding it as a child for once only controller.

But when I test it by adding about 100 or 200 thread the login is also running that much of time. I want to run login request for only starting thread. Is it possible? Below I added my test case hierarchy.

 ThreadGroup: 
 HTTP request default 
 HTTP cookie manager
     once only controller
 login HTTP request
 HTTP request for number of users 
Edit
Report

2 Answers

3

You can put the "Login HTTP request" in the Once Only controller and the normal "HTTP request" in a Loop controller. Now you can set the loop to execute the HTTP request 100 or 200 times. See: jmeter.apache.org/usermanual/component_reference.html#Loop_Controller

Use Timers to make a more realistic test. Say you want the 200 requests to happen in 120 seconds then you can make each request pause for 120/200 seconds. Most timers work with miliseconds so you can make that number (120/200 * 1000) miliseconds. See: jmeter.apache.org/usermanual/component_reference.html#timers

You could also create a separate Setup threadgroup where you do your login and do the 200 threads in an another threadgroup. Check this article: http://www.informit.com/guides/content.aspx?g=java&seqNum=520

All this information should help you in the right direction. Good luck!

answered 2011-01-21T11:09:33.743
0

In Jmeter 2.9, you can use the "Once only Controller" and "Loop Controller" to do that.

It is wonderful!

Frankie

answered 2013-02-20T07:29:14.597

Your Answer