sqeeky
sqeeky

Reputation: 165

Jmeter - restart session after expired continually for 10 hours

My current environment: JMeter v2.11, remote Oracle 12, JDK 7

I have a soak test to generate in Jmeter and I'm unsure quite how to do what I need.

Essentially - I have a recorded script for 200 users to login to a web application within 1 thread group but I need to keep this going for 10 hours.

The http sessions will expire after 15mins, so I'm a little lost how to make the session restart once the http session has expired. I have had a think, I've played with 'Loop Count' settings on the thread group, I've googled for an answer, and I've searched on this forum but I haven't found anything that I can see is relevant (although I did find stuff that was quite interesting).

My current workings are as follows:

Thread Group - Number of Threads --> 200, Ramp Up --> 50, Loop Count ---> 1 --HTTP Request Defaults --HTTP Cookie Manager --Recording Controller ---HTTP Request - Login Page Launched ---HTTP Request - Username Input ---HTTP Request - Password Input ---HTTP Request - Login Button selected ---Some listeners

As with my previous posts - I am very grateful for any guidance anyone can provide.

Cheers!

Upvotes: 0

Views: 1118

Answers (1)

Dmitri T
Dmitri T

Reputation: 167992

JMeter works as follows:

It starts all defined virtual users (threads) within the bounds of ramp-up period provided. In your case it means that JMeter adds 4 new virtual users each second for 200 seconds.

Each thread executes samplers upside down as fast as it can. when sampler finishes its work and doesn't have more loops to iterate it is being shut down.

If you want your scenario to run over 10 hours set "Loop Count" to "Forever" and specify "Duration" on Thread Group level to be 36000 seconds as per image below:

Thread Group Scheduler

In this case you'll get 200 concurrent users executing defined samplers for 10 hours.

Another option to specify test (or particular test part) duration is using Runtime Controller

Just in case if you need not 200 concurrent users but 200 requests per second, take a look at Constant Throughput Timer documentation.

Also JMeter acts on protocol level, it doesn't actually type anything into inputs or clicks buttons so my expectation is that you scenario should look as follows:

  • Open Login Page (HTTP GET)
  • Perform Login (HTTP POST)

Hope this helps.

Upvotes: 1

Related Questions