Select Page

Basic API Test Automation with Postman

Numerous API testing tools offer manual and automated test development. Perhaps the most popular tool is Postman, which offers a free version along with a high-quality set of online tutorials and support information for API testing.

The example steps below cover the basics of creating an API request test and identify the sections to review.

Quick Postman tutorial

To get started, download the desktop version or use the online version. Set up an account, and create a Workspace.

Once you have a Workspace, you’re ready to start creating requests for testing. Select the HTTP Request option. For each new request, Postman opens a new tab labeled “Untitled Request.” Always set a title that summarizes the test objective and API for easier test identification.

Create a new HTTP request.

Once you have set a title, then choose GETPOST or PUT and enter the API endpoint URL. Set any known parameters and authorization headers, then choose a body type and set the request data.

You’ll know if the API requires parameters or only a body, or security information within the authorization header based on the API’s documentation. Most API documentation also includes a sample request body to copy or use for reference.

Podcasts

Testing in Two Days

For software testers, it’s always crunch time. Striking the balance between effective and expedient testing isn’t always easy, but it’s necessary in our fast-moving digital world.

View the sample request in the screenshot above. Notice the request tab displays the name, method (GET) and the endpoint URL from my API documentation. Postman will automatically add the necessary headers based on the API.

If the API requires security authorization, you’ll need the authentication credentials and the security type to generate a valid security token. Most organizations keep API security tokens available through the API developer or an IT manager.

Our test request is ready to go. Select the Send button. Review the example below. After you send the request, the response populates in the lower half of the window. The best format is JSON, but the format is determined by the API so choose the one you need. Notice there is additional information to the right including the response status code.

Postman displays the keys and values for the query. The API response populates in the lower half of the window -- JSON is the format in this example.
The API response populates in the field below.

To create test automation from a request, get started by selecting the Tests tab, which displays on the same line as Params and Authentication. View the code snippets on the right side to create automated API tests. Every time a request is sent, the automated tests execute and automatically populate the Test Results tab.

The Tests tab of the Postman workspace is highlighted. Options for Script with Postbot are displayed to enable the user to execute automated tests.
Use Postman test automation functionality.

In this example, I used two code snippets but only edited the first, so it displays as passed. The second one fails because it was not updated to match the API requirements. Testers must always edit the code snippet to match the API’s expected response data. Postman provides detailed support information and training.

Ultimately, API testing is an excellent way to evaluate the back-end infrastructure. Testing APIs is beneficial for customers as well as internal developers and users to ensure continued functionality post-release as well as during development cycles. Give your product an edge by investing in API testing.

eBook

The Essential Guide to Crowdtesting

Get the facts about crowdsourced software testing. In this guide, you’ll learn how leading brands across industries deliver better quality releases, at speed and scale.

Want to see more like this?
Amy Reichert
Amy Reichert
Freelance QA SME/Test Engineer
Published On: September 7, 2023
Reading Time: 4 min

Key Considerations for Using LLM-as-Judge

Discover how to reduce risk when using models to evaluate AI systems and how to effectively use LLM-as-Judge.

The 10X QA Team: How to Effectively Scale Your QA Strategy

Learn how an agentic engine with human-in-the-loop validation can scale your testing without defect leakage.

The Most Common Gaps in Agile Testing

Close critical Agile testing gaps to promote high-quality software delivery

Avoiding The Hidden Cost of Payment Failures

Learn how you can improve your payment experience and protect revenue across markets, methods, and moments.

Claude Code Crash Course: How to Master Claude Code for QA Engineering

Discover how you can use Claude Code to safely implement AI tools and skills to accelerate your testing lifecycle.

Why Test Plans Fail in the Real World

Your current test strategy might be the reason products fail. Find out why test plans must be adaptable.
No results found.