简体   繁体   中英

JMeter - How to run two thread group concurrently?

I have two thread group:

  1. Authentication Thread Group
  2. 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.

There is a special box in the Test Plan which allows JMeter to run Thread Groups at the same time:

在此处输入图像描述

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, ie :

check out Using JMeter Variables With Multiple Thread Groups guide for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM