简体   繁体   中英

JMeter share setUp Thread Group variables with normal Thread Group

Imagine I have a simple test plan, like so:

setUp Thread Group
-- Http Request
---- JSON Extractor

Thread Group
-- Http Request

tearDown Thread Group
-- Http Request

By default, the variables extracted in the setUp Thread Group will not be accessible within the ordinary Thread Group nor the tearDown Thread Group . The variables' contents are different for each user and cannot be precomputed and loaded into the test plan. It is not possible to simulate the correct load using a single user.

How can I access each thread's setUp variables from within the corresponding Thread Group proper and tearDown?

JMeter Variables scope is limited to current Thread Group only, if you need to pass some data between different Thread Groups you need to convert JMeter Variables into JMeter Properties:

More information: Knit One Pearl Two: How to Use Variables in Different Thread Groups

You stated in comments

5000 distributed threads.. transferring multiple variables...

Maybe JDBC Request s will help you to save(insert) variable to database and get(select) variable and delete/update variable wherever you are in test.

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