0

I have to design a test plan for an app and below is the requirement

Run a thread for 1 user for 55 minutes and in between after the thread starts I need to run another user after 30 minutes.

Can you give any suggestions on how can design and what kind of threadGroup can i use?

Update: I have two groups, the first group will start and run for 120 minutes and the second group of users will start after 30 minutes.

enter image description here

2 Answers 2

0

To design a test plan for performance testing using JMeter for an interval of time with the given requirement of running a thread for one user for 55 minutes and then running another user after 30 minutes, you can follow these steps:

  1. Create a new test plan and add a thread group to it.

  2. In the thread group, set the number of threads to 1 and the ramp-up period to 1 second. This means that one user will be simulated and will start running immediately.

  3. Add a timer to the thread group by right-clicking on it, selecting Add -> Timer -> Constant Timer. Set the Thread Delay field to 30 minutes (in milliseconds, this is 1800000) to delay the start of the second user.

  4. Add a new thread group to the test plan by right-clicking on the test plan and selecting Add -> Threads -> Thread Group.

  5. In the new thread group, set the number of threads to 1 and the ramp-up period to 1 second. This means that one user will be simulated and will start running immediately after the timer delay.

  6. Add a duration controller to the second thread group by right-clicking on it, selecting Add -> Logic Controller -> Duration. Set the duration to 55 minutes to simulate the activity of the user.

  7. Add the necessary HTTP requests and samplers to the thread groups.

That's it. Now run your test.


Edit:

Understanding from the edit in your question, you can add the Constant Timer to the Test Plan instead of the Thread Group to achieve the desired behavior. Here's how it will work:

  1. Add a Thread Group with 1 user and set the duration to 55 minutes.

  2. Add the sampler(s) to this thread group that you want to run for the first user.

  3. Add a Constant Timer to the Test Plan with a value of 1800000 milliseconds (30 minutes). This will create a delay of 30 minutes before the second user starts.

  4. Add another Thread Group with 1 user and set the duration to the remaining time after 30 minutes, which will be 25 minutes.

  5. Add the sampler(s) to this thread group that you want to run for the second user.

  6. Run the test plan and the first user will run for 55 minutes, and after 30 minutes the second user will start running and continue for 25 minutes.

Here's an example of how the Test Plan could be designed with the above configuration:

Test Plan

  • Thread Group 1 (1 user, 55 minutes duration)
    • Sampler(s) for first user
  • Constant Timer (value: 1800000 milliseconds)
  • Thread Group 2 (1 user, 25 minutes duration to end the threads simultaneously or else 55 minutes to run both threads for equal duration)
    • Sampler(s) for second user Note: The duration of the second thread group can be adjusted based on the remaining time after the 30 minutes delay.

I hope this solution helps you design your test plan for performance testing using JMeter for an interval of time as per your requirement.

2
  • Thanks Milin, I Updated the my question with diagram can you check Mar 16 at 4:26
  • In this case try creating 2 thread groups with 1 user each and add the constant timer in only the second thread group and see how that works out. Or better yet, add the constant Timer with the delay to the Test Plan and keep it in between the 2 thread Groups. This may work out as per your requirement. Mar 16 at 4:38
0

The easiest is going for 2 separate Thread Groups of 1 thread and specify "Startup Delay" of 1800 seconds for the 2nd Thread Group

enter image description here

You can also consider using Ultimate Thread Group (can be installed as a part of Custom Thread Groups bundle using JMeter Plugins Manager) which provides easy visual way of defining the workload

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.