Compute Response Time in Postman

Compute Response Time in Postman

When developers start to speed up an API the QA department usually get two types of tasks:

  1. Сheck that handlers work the same way as they worked before (that could be tested by comparison of responses);
  2. Check that handlers start work faster.

«Start work faster» means starting to respond in less time. Response time is a common non-functional requirement for the API or its particular handlers or methods.

Postman allows to test the response time, but one check is often not enough. For complex testing of response time we need to measure:

  • Average response time, based on a large number of requests;
  • Maximum (peak) response time to find out the extremes.

To perform such testing we should:

  1. Run required request multiple times through Postman collection runner;
  2. Save each of response time into variable;
  3. Calculate average and maximum timings.

First of all, we need to create a variable without value.

Global variable = timings
Global variable = timings

Then, write a few lines of code in the Tests tab of the request (I took for example one handler of The COVID Tracking Project API). For convenience, I have output the calculated data into the test name.

The only edge case is the first or single request, which should be taken into consideration and properly handled.

Single request
Single request

Now, we should clear the variable’s value (otherwise it will affect our subsequent results) and run the collection with a significant amount of iterations.

Collection runner
Collection runner

On the last request we will get average and maximum response timings.

Response timings
Response timings

When we perform the same test (run this collection with the same number of iterations) for two handlers: the benchmark and the new one, we can compare our metrics.

Of course, such kind of non-functional testing could be made via more professional tools like JMeter or LoadRunner.

--

--

--

Quality assurance engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Mary Jo Foley Doesn’t Get Microsoft Tasks

B.E.M-Why,When and How?

Learning about Reactive Messaging Patterns

AWS Governance at Scale with Jamcracker Cloud Management Platform

StorPool and ITGix partner to deliver high-performance deployments with OpenStack and Kubernetes

MLOPS Task1

Solving MalwareTech Shellcode challenges with some radare2 magic!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrey Enin

Andrey Enin

Quality assurance engineer

More from Medium

How does Selenium Page Factory work with Cucumber?

Handling dynamic web tables in Selenium : power of custom XPath

Verification and Validation in Testing

Write First Selenium-Cloud Test with Sauce Labs