I have two thread group:
- Authentication Thread Group
- REST API Thread Group.
In the first thread group(Authentication Thread Group) I will be generating "access token" using "refresh token" using HTTP request and using JSON parser "access token" is taken. The access token is passed to second thread group(REST API Thread Group) using Inter thread communicator.
The passed access token is used for authenticating the REST APIs in REST API Thread Group.
Using Flow Control Action I had set the Authentication Thread Group to run on interval, so that I can get the new "access token" before it gets expired. Now I am trying to run REST APIs with the current "access token".
So basically I want to run RESP APIs with its respective Thread Group logic, meanwhile the authentication Thread Group has to be executed for given delay time.
Suggest a way to achieve the above? Alternate solution for authenticated REST API is also appreciated.
CodePudding user response:
if you untick it - JMeter will run all the Thread Groups in parallel.
Apart from this your "way to achieve the above" is correct.
Alternative solution would be switching to JMeter Properties from the Inter-Thread Communication plugin, i.e. :
- use __setProperty() function to convert the token into JMeter Property in "Authentication" thread group
- use __P() function to read the token in the API thread group
check out Using JMeter Variables With Multiple Thread Groups guide for more details.