Reputation: 113
I want to create properties variable for each Thread and this is unique and i can use it in another input. So does anyone can suggest me the way to do it? Is __threadNUm is the easiest way to do it?
Upvotes: 1
Views: 749
Reputation: 168002
In order to set the property you can use __setProperty() and __threadNum() functions combination like:
${__setProperty(PROPERTY_PREFIX_${__threadNum},PROPERTY_VALUE,)}
Replace PROPERTY_PREFIX
and PROPERTY_VALUE
with your own values
To read the property value per thread you can use __P() and __threadNum() functions combination like:
${__P(PROPERTY_PREFIX_${__threadNum},)}
Demo:
Another solution is using Inter-Thread Communication Plugin which is handy for sharing values across different threads (even if they are in different thread groups). The exact instructions will differ depending on what you're trying to achieve, you can see SynchronizationExample.jmx test plan for reference.
You can install Inter-Thread Communication Plugin using JMeter Plugins Manager
Upvotes: 1