Test performance of multiple APIs at a time using Jmeter

4.7k views Asked by At

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.

1

There are 1 answers

0
Dmitri T On BEST ANSWER
  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.