a4aravind
a4aravind

Reputation: 1232

How to pass a set of values from one Jmeter Thread group to another

I'm stuck with a scenario of passing a set of values which I get as the output of one thread group's execution to another thread group. I have been using "Beanshell assertion" to do the same by using the

 ${**__setProperty**(categoryID, ${categoryID})}

method only for one category. But the issue came when I started running the thread group in a loop for 5 category's so that the value of categoryID gets set with the category's thread's output value. These two screenshots may help understand the testplan I'm following:

CourseCrationThread

GetBatchNotCouse

So as per the first picture depicts, I have total 5 threads running in 12 loops. Now as I mentioned, I need these 5 categoryID's to get stored separately so that I can get it separately and use it for the next thread group.

Upvotes: 1

Views: 1596

Answers (1)

Ori Marko
Ori Marko

Reputation: 58882

You can save different variables per thread using __threadNum function

 ${__setProperty(categoryID_${__threadNum}, ${categoryID})}

And then get it using same function:

${__property(categoryID_${__threadNum})}

Upvotes: 1

Related Questions