Reputation: 842
I wrote a Script in Test Case inside BeanShell PreProcessor and I want to use the value(Integer) in ThreadGroup.
By using vars.put()
we can only share String type of values.
NOTE: I want to use the value in Number of Threads(users) block
Upvotes: 0
Views: 3127
Reputation: 168217
There are at least 3 ways of doing this:
vars.put("foo", String.valueOf(bar));
Use bsh.shared namespace like:
bsh.shared.myInt = 15
See How to Use BeanShell: JMeter's Favorite Built-in Component guide for more information on Beanshell scripting in JMeter tests
NOTE! you won't be able to amend number of threads in the current Thead Group using Beanshell test elements.
Upvotes: 1