Book Image

API Testing and Development with Postman - Second Edition

By : Dave Westerveld
5 (1)
Book Image

API Testing and Development with Postman - Second Edition

5 (1)
By: Dave Westerveld

Overview of this book

Postman is an invaluable tool for exploration and testing of web APIs and helping testers and developers figure out how an API works. With Postman, you can create effective test automation for any APIs, and this guide will help you unleash its full potential. API Testing and Development with Postman is an invaluable resource for anyone who wants to create a good quality API, but isn't sure how to go about it. This guide will help you unleash the full potential of Postman’s test automation capabilities. A combination of theory coupled with real-world examples will help you learn how to use Postman to create well-designed, documented, and tested APIs. After you’ve familiarized yourself with the theory, you’ll move on to hands-on projects that will teach you how to add test automation to an existing API. You’ll also learn some of the new and powerful features that Postman has that can help you avoid introducing bugs. This second, fully updated edition features new chapters on workflow testing, creating and using mock servers, API security testing, and performance testing. The new and expanded information in this edition will help you future-proof your APIs. By the end of this book, you'll be able to use Postman to set up and run API tests for any API that you are working with.
Table of Contents (12 chapters)
1
API Testing and Development with Postman, Second Edition: API creation, testing, debugging, and management made easy

Using Flows in Postman

The Flows feature is a relatively new feature in Postman. You can create a flow by going to new and choosing the Flows option.

Figure 8.1 – Creating a New Flow

Usually, the first thing you will want to do with a flow is to add a block.

Figure 8.2 – Add a block to the Flow

Choose the Send Request option and then click anywhere one the canvas to place the block.

Configuring a Send Request Block

You can configure the send request block with the following steps:

  1. In the block, you can click on the Add request field and choose a request to that you’ve previously made. Click on that field and from the Linear Workflow collection choose the Create ToDo request.
  2. Click on the Add environment field and choose the ToDo Env
  3. From the Body Type dropdown choose the JSON option.

You will notice that it has identified that this request relies on the base_url variable. The value of this variable is already being set by the environment that you’ve...