Reputation: 137
I am new to jmeter. Writing script as below:
Thread group1: Token generation
Thread group2: Use token created in Thread group1 and call API.
Need to execute Thread group1 after every 10 mins, so that new token is generated and it is used by Thread group2.
Upvotes: 0
Views: 451
Reputation: 168147
In order to implement a 10 minutes "sleep" Add a Flow Control Action sampler (earlier was Test Action) to 1st Thread Group and configure it to Pause
the thread for 600000
milliseconds - 10 minutes
According to JMeter Best Practices you should always be using the latest JMeter version so consider migrating to JMeter 5.0 (or whatever the latest version available at JMeter Downloads page) as soon as possible.
Upvotes: 2
Reputation: 137
Below solution worked for me:
In Thread group2 call the API.
Then extract the status code using Regular Expression Extractor.
Add if controller.
NOTE: The only drawback is that, when a request fails then only new token is generated.
Upvotes: 0