Search code examples
jmeterjmeter-pluginsjmeter-5.0jmeter-4.0jmeter-3.2

Jmeter share data from setupthreadgroup to normal threadgroup


How to share the list of lists variable from setupthreadgroup to a normal threadgroup in jmeter?

for instance if I have list1=[[1,2],[3,4],[5,6]] in setupthreadgroup and same I want to use in subsequent thread group. How can we achieve this?

I am trying to save this using props.put('listOfData',list1) in setupThreadGroup and in normal threadGroup I am trying to access it using props.get(listOfData[1][1])


Solution

  • You need to change this one:

    props.get(listOfData[1][1])
    

    to this one:

    props.get('listOfData')[1][1]
    

    props is just a shorthand for java.util.Properties, see the JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information on this and other JMeter API shorthands available for the JSR223 test elements