I’m new to JMeter and I was given a task to create a JMeter script to handle both internal and external user requests at the same time within the script itself.
Here is the requirement.
- Total user count should be – 5
- Total requests that are generated via script should be – 20
- Time duration should be – 20s
The given API request can be invoked by both internal and external users. So, within this total 5 user count must be included both user types, and that internal and external counts should be decided while the execution of the script by JMeter.
Ex:
For 1st execution -> internal user count may be 3/ external user count may be 2 (total = 5).
For 2nd execution -> internal user count may be 4/ external user count may be 1 (total = 5).
So, these internal and external user counts can be varied time to time because it is decided by the JMeter while execution.
However, those 5 users (internal + external) should generate 20 requests in total, and within 20s. So, script should be run 20s.
After doing some research, I prepared below script.
Here, I have used a Constant Throughput Timer to distribute the load in 20s (For 20s, requests should be 20. Therefore, for 1min requests should be 60).
And created 2 Transaction Controllers to handle internal and external users separately.
Here issue was, after executing the script, it generated around 40 requests not 20 requests. But my requirement is to generate 20 requests by 5 users within 20s time.
Please can anyone help me to get sort out this problem?