0
votes
  1. Assume 2 requests in a thread group. Thread count is 100
  2. Http sampler A, Http sampler b
  3. I have extracted a set of values using JSON extractor and stored in a variable
  4. I used the extracted values in request sampler b (added controller for each extracted values)
  5. when I try to execute this script both the request ran for 100times
  6. So I have added once the only controller for the 1st request. Even though both the request ran for 100times

I want to execute Request A for one time and request B for 100times. How can we achieve this?

1
is this homework help or something. or some code puzzle contest? I apologize if it is not.Jay

1 Answers

0
votes

As per documentation JMeter Variables are local to the thread (virtual user) so if you use variables from HTTP Sampler A in HTTP Sampler B you need to execute HTTP Sampler A once per user which gives you 100 executions.

If you're looking for a way to execute HTTP Sampler A only once, no matter how many threads you have:

  1. Add setUp Thread Group to your Test Plan and keep threads/loops count as 1
  2. Put your HTTP Sampler A under that setUp Thread Group
  3. Save each value from JSON Extractor into a JMeter Property using __setProperty() function
  4. In your main Thread Group use __P() function to access the values extracted in the setUp Thread Group