Reputation: 49
I am using two JSR223 preprocessors,in which I want to use variable from one preprocessor into another preprocessor.
how can I use this in Jmeter??
Please assist me with an example.
Upvotes: 2
Views: 8657
Reputation: 168157
In the first PreProcessor store some value into a foo
JMeter Variable using vars
shorthand for JMeterVariables class instance like:
vars.put('foo', 'some value')
In the second PreProcessor you can read the value using the same vars
shorthand like:
String myString = vars.get('foo')
See Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information on this vars
shorthand and other JMeter API shortcuts available for the JSR223 Test Elements
The variable can be seen using Debug Sampler and View Results Tree listener combination.
Upvotes: 4