performance - JMeter - How to loop through "bsh.shared" ArrayList in a single Thread Group? -


i have beanshell postprocessor under setup thread group. put arraylist "bsh.shared" namespace like:

list personidslist = new arraylist(); ... bsh.shared.personids = personidslist; 

i know how read value via __beanshell function as:

${__beanshell(bsh.shared.personids)} 

and want loop through array in other thread group. (${personid} - should iterating value list)

enter image description here

could you, please, tell me how that?

thanks!

the easiest way using while controller counter test element like:

  1. add while controller 2nd thread group , put following expression "condition" area:

    ${__beanshell(integer.parseint(vars.get("counter")) < bsh.shared.personids.size()-1,)} 
  2. add counter child of while controller , configure follows:

    • start: 0
    • increment: 1
    • maximum: ${__beanshell(bsh.shared.personids.size()-1,)}
    • reference name: counter
  3. refer "current' person id ${__beanshell(bsh.shared.personids.get(integer.parseint(vars.get("counter"))),)} required

demo: jmeter beanshell counter demo


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -