Helping Hands
Helping Hands

Reputation: 5396

How to control no. of requests per user in Jmeter

I am doing load testing for one ecommerce website. I am using Ultimate thread group.

Now I want to send per user only 1 request. So for ex: If 500 users then only 500 request should send. How can I achieve it using Ultimate thread group?

Why I want above because I am doing whole process like login, select product, add to cart and checkout. So it should do everything only once per user.

Upvotes: 0

Views: 2449

Answers (3)

Dmitri T
Dmitri T

Reputation: 168042

Your test design is a little bit flaky as given each user does login, select product, add to cart and checkout you will have at least 4 requests per user which gives 2000 requests in total (doesn't include embedded resources calls). You can use Transaction Controller to group these requests into one "workflow" however it won't limit actual amount of requests.

Normally web test plan should look as follows:

  • Given each user executes test scenario steps and acting like a real user
  • Gradually increase the number of users unless application response time becomes too high or errors start occurring, whatever comes the first
  • Analyze results, identify the bottleneck, report your findings

Upvotes: 1

NaveenKumar Namachivayam
NaveenKumar Namachivayam

Reputation: 1202

You can use Throughput Controller.

The Throughput Controller allows the user to control how often it is executed. There are two modes:

  • percent execution
  • total executions

Percent executions causes the controller to execute a certain percentage of the iterations through the test plan.

Total executions causes the controller to stop executing after a certain number of executions have occurred. Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts.

Upvotes: -1

vins
vins

Reputation: 15370

Lets say the duration of the test is 1 hour. First user completes the workflow you had mentioned in the first 10 mins itself. What should happen after the workflow for the user? Should the thread be idle for the remaining 50 mins?

I think you should use the regular Thread Group with 500 threads and loop count as 1. Ultimate Thread Group is for duration based tests. You could use Once Only Controller as a workaround inside to do the action only once for the user. But it is an ugly approach.

Upvotes: 1

Related Questions