Reputation: 658
I have a BeanShell PostProcessor under the setUp Thread Group.
It generates an ArrayList that I want to pass as a system property to the test Thread Groups in the Test Plan.
That array contains the number of threads in the test groups.
What is the syntax? How should I refer an element of that array in the Tread Group "Number of Threads (users)"?
This is what I have in the setUp Thread Group
ArrayList users = new ArrayList();
${__setProperty(users, ${users})};
This is what I put in the Number of Threads
${__P(users).get(0)}
Upvotes: 0
Views: 7816
Reputation: 168092
If you really need the "ArrayList" you can go it using bsh.shared namespace
In setUp Thread Group put the ArrayList into the "bsh.shared" namespace like:
ArrayList users = new ArrayList();
users.add(5);
bsh.shared.users=users;
In normal Thread Group you can read the value via __BeanShell function as:
${__BeanShell(bsh.shared.users.get(0),)}
However I feel that your test is badly designed and you could get rid of scripting or at least of using arrays.
Upvotes: 1