JMeter tips and tricks – Part 2Rahul Goel
Listen on the go!
Further to our previous blog here is the next one:
How to run JMeter test plan for specified amount of time?
There are two ways to specifying certain amount of time to run a JMeter test plan.
- In the Thread Group Element, Check scheduler and specify the Duration in seconds. If you want to run Jmeter test plan for 30 minutes then enter 1800 as shown below.
- Create a Thread Group which should contain your actual samplers.
- Add two Test Action samplers to the above Thread Group
Add -> Sampler -> Test Action
- Click on Test Action 1 and enter below setting.
Select Target as Current Thread and Action as Pause and enter 1800000
Milliseconds (30 minutes duration). This sampler acts as a Pause.
- Click on Test Actin 2 Sampler and specify below settings.
Select Target as All Threads and Action as Stop. This sampler stops the
Execution once it reaches the specified duration
- Make sure you unchecked Run Thread Groups consecutively option in Test Plan.
Summary: When we want to execute the load test for specified amount of time i.e. 2 hrs. Then we go for above either of two techniques.
I have created a test case for login & booking like ola/uber app. I need to pass a user authentication key for next call. For single thread it works. But if i increase thread count, authentication failed response showing. So i need to pass recently executed login authentication key for next call. How do i? Please help me out to execute the load test. I need a beanshell post procesor query to pass recently generated auth key.