0

I have some 100 RESTful APIs in my projet.

For a specific reason I want to run all 100 APIs in one go, each one say with loop-count of random number 'n'.

Is it possible. How can I do it. May be by writing a script or something?

One suggestion was - Using CSV data set config we can test multiple instances of single API (say Login API testing for 1000 users).

But in my case i want to test 100s of API in one go. And for each API - the HTTP Request parameters like Method(GET/POST/GET etc), Path and Body Data will be different.

I don't see any way of setting these HTTP Request parameters using CSV data set config also.

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
Naveen Kumar
  • 384
  • 2
  • 11
  • 31
  • where do you have all the APIs in a CSV? the you can use CSV data set config along with loop controllers – Prakash Palnati Sep 08 '17 at 08:56
  • @PrakashPalnati : using CSV data set config we can test multiple instances of single API (say Login API testing for 1000 users). But in my case i want to test 100s of API in one go. And for each API - the Method, Path and Body Data will be different. I don't see any way of setting these HTTP Request parameters using CSV data set config. – Naveen Kumar Sep 08 '17 at 11:22
  • I think this question is too big for SO and too unclear. Do you want to run 100 threads, each with different HTTP request? or do you want to run 1000 users/threads for each of 100 APIs? and you want dynamic configuration for HTTP request it seems, but how different are various requests? what kind of response they have and so on. I suggest that you split it to 2 separate questions: design with dynamic HTTP and execution, and also provide a more clear description of your expectations and what did you try so far. – timbre timbre Sep 08 '17 at 14:18

1 Answers1

0
  1. To execute your requests for random number of times you can use __Random() function. The function can be placed either directly in the "Loop Count" section of the Thread Group or in the Loop Controller
  2. If you want to parameterise different samplers with different data it would be logically compliant to use different CSV Data Set Config instances. As other config elements CSV Data Set Config is following Scoping Rules so if you put it as a child of a sampler - it will be applied to this sampler, therefore you will be able to have as many CSV Data Set Config elements as you like:

    JMeter CSV Data Set Config

  3. And finally you don't have to keep test scenarios testing different API endpoints under the same Thread Group, you can use different Thread Groups to keep test scenarios for different API endpoints. Moreover, you can use separate Test Fragments or even separate .jmx files to store the tests against different API endpoints.

If above doesn't answer your question you will need to amend it to clearly state what you are trying to achieve so we could come up with the most appropriate JMeter configuration.

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