My Organization is having set of 5 http requests. R1,R2 to R5. Each http request uses Addr and City as input along with user ids. And there are 500 Users in csv sheet to use for those 5 requests. We'd like to have aprrox or exact 50 request per user, divided into 5 api requests. And additional condition is R1 should have more weight in 50 req So it looks like this

User1 >> R1=20Request, R2=10Request, R3=10Request, R4=5Request, R5=5Request >> 50
User2 >> R1=20Request, R2=10Request, R3=10Request, R4=5Request, R5=5Request >> 50
User3 >> R1=20Request, R2=10Request, R3=10Request, R4=5Request, R5=5Request >> 50
..
User500 >> R1=20Request, R2=10Request, R3=10Request, R4=5Request, R5=5Request >> 50

I have tried following test plans

Test plan 1 (10 Thread, loop count 5, loop controller loop count 1)
>>CSV Data Config Users
>>CSV Data Config Addr
>>CSV Data Config City
>>Thread Group 
 >> loop controller
  >> R1
  >> R2
  >> R3
  >> R4
  >> R5
Test plan 2 ( Using % distribution for Throughput controller with 5min run)
>>CSV Data Config Users
>>CSV Data Config Addr
>>CSV Data Config City
>>Ultimate Thread Group 
 >> Throughtput controller
  >> R1
>> Throughtput controller
  >> R2
>> Throughtput controller
  >> R3
>> Throughtput controller
  >> R4
>> Throughtput controller
  >> R5
Test plan 3 (10 Thread, loop count 5, loop controller loop count 1)
>>CSV Data Config Usrs
>>setUp Thread Group
>>CSV Data Config Addr
>>CSV Data Config City 
 >> loop controller
  >> R1
  >> R2
  >> R3
  >> R4
  >> R5
Test plan 4 (10 Thread, loop count 5, loop controller 1 loop count 1, LC2 count 2)
>>CSV Data Config Users
>>CSV Data Config Addr
>>CSV Data Config City
>>Thread Group 
 >> loop controller 1
  >> R2
  >> R3
  >> R4
  >> R5
>> loop controller 2
  >> R1
  

Problem statement:

  1. In TestPlan1,3 & 4 we are able to use all of the users from CSV but request count is not getting to 50 at all
  2. In TestPlan2 all users from csv are not getting used and request count sometime exceeds and sometime seen below 50
1

There are 1 best solutions below

0
On

The easiest option is just to add another copy of the R1 like:

Test plan 1 (10 Thread, loop count 5, loop controller loop count 1)
>>CSV Data Config Users
>>CSV Data Config Addr
>>CSV Data Config City
>>Thread Group 
 >> loop controller
  >> R1
  >> R1 (another copy)
  >> R2
  >> R3
  >> R4
  >> R5

instead of "stupid" copying and pasting a HTTP Request sampler you can define a Test Fragment containing this R1 request and reference it twice using Module Controller

If your "weight" criteria are more complex it might be a better idea to consider using Weighted Switch Controller instead.