Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
Is it possible to store each return of the same http request in an array in jmeter?

In my post processor I have the following code:

if (i as Integer < protocolsArray.length){


          
protocolsArray[i as Integer] = "${requestProtocolId}" ;

}

and it worked, I put the "requestProtocolId" that I got via JsonExtractor in the position of "i", position of i == 0

but the number of virtual users defined in this http request is greater than one.

so it sends the request again and saves the new "requestProtocolId" again in position zero, overwriting the other protocol,I understand that with the new request it starts all over again, taking the initial values ​​assigned to the variables again, but I've already tried incrementing the i (i ++) and returning the new array with the zero position filled in:

vars.putObject("protocolsArray", protocolsArray);

but it always returns the value set before the htpp request, is there a way to change that?

If I changed and put an iteration controller and it was a group of users but in iteration controller "5", it would be like the same user would send it five times, right?

I wanted to simulate different users, but always keep the "requestProtocolId" value saved in the array positions because I'm going to use it in another request.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

In its current state your question doesn't make a lot of sense.

  • JMeter Variables are local to the thread (virtual user)
  • If the user starts new iteration - the variable will be still there, if this is not something you want/expect - use vars.remove() function to ensure that the variable is always "fresh"
  • Don't inline JMeter Functions or Variables in scripts, in case of Groovy (the recommended scripting option) only first occurrence will be cached and used during other iterations, see JSR223 Sampler documentation for more information
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!