Programming Postman Tests

Overview

In this section, we’ll create a new test collection in Postman, write a series of happy-path tests, and then execute them to inspect our results. To do this, we need to log in first.

Create a collection

The first step in testing with Postman is to create a new test collection. Click the “+ New Collection” link that appears near the top of the left sidebar of the Postman interface. This calls up the “Create a New Collection” dialog box, as shown in the following screenshot. Here, we can enter a name for the collection and a description. For now, let’s enter “Company API Home Tests” for the name and enter a short description, such as “This collection tests the Home resource of BigCo’s Company API.” We can skip the other tabs for now and just click the “Save” button in the bottom-right corner.

Get hands-on with 1200+ tech skills courses.