I know there is a way to measure the response time of a Rest API with Rest Assured. But can we increase the user load and measure the response time using Rest assured ,or is there any other suggested way to count in those parameters (Load / Stress) using API Testing. TIA
Asked
Active
Viewed 4,436 times
1 Answers
1
If you're interested in Response Time only you can run your Rest Assured tests into with JMX (Java Microbenchmark Harness) to get some basic information how your system behaves under the load.
However be aware that load and stress testing is not only about response time
- You need to come up with realistic patterns of your API usage as if your load test will not represent end-user or end-application workload this test does not make sense
- It is better to increase and decrease the load gradually as this way you will be able to correlate increasing response time and other metrics with the increased number of threads (virtual users)
- It is better to go for a specialised tool as response time is not enough when it comes to bottleneck analysis, you will need at least to measure time required to establish the connection, network latency and time to first byte. It will also be good to include collection of at least CPU, RAM, Network, Disk usage on the application under test side and your application-specific metrics (if any)
So I would recommend going for i.e. Apache JMeter you can re-use your Rest Assured code in JSR223 Sampler(s) or JUnit Request Sampler

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