0

I have a requirement where I will run a search API which will return me a list of object, each with unique 'facilityID'. I need to create a list of them and use them in another HTTP Delete Request. I have to pass the values as path variable and there are multiple simultaneous threads.

Example: Search API return following IDs: [18c2, 77v3, 45f1]

Now in my Delete HTTP Request, different threads should fetch an Id from the list and bind it to the path variable of the URL.

I read about JSON extractor and am using following expression in Search API,

$.result[*].facilityId

This should return me the list, but how do I make sure that each thread should pick one value from it and hit the API?

rishav
  • 441
  • 9
  • 27

1 Answers1

0

I assume you came up with the correct JSON Extractor configuration and got the following JMeter Variables, i.e. you can observe the next values for the Debug Sampler in the View Results Tree listener

facilityId_1=18c2
facilityId_2=77v3
facilityId_3=45f1
facilityId_matchNr=3

enter image description here

If your goal is to run Delete requests concurrently for each thread - you can consider using __V() and __threadNum() functions combination - this way each JMeter thread will delete its own facilityId

enter image description here

Check out Here’s What to Do to Combine Multiple JMeter Variables for more information if needed.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133