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
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.