Postman The Complete Guide

Tags: Postman

Postman API testing for manual and automated tests. Automate with Newman, Jenkins or any other CI tool.

Last updated 2022-01-10 | 4.6

- Create GET
- POST
- PUT
- DELETE request
- Understand GET vs POST request method
- Work with real-world APIs (Github API
- Trello API)

What you'll learn

Create GET
POST
PUT
DELETE request
Understand GET vs POST request method
Work with real-world APIs (Github API
Trello API)
JavaScript basics for tests
Write API tests in Postman
Use data from Excel files (CSV) or JSON
Use Postman variables to create workflows and scenarios
Run API tests with Newman in Jenkins
GitLab CI or TeamCity
Use OAuth2
API keys
tokens
JWT
basic auth
Test file uploads
Use mock servers
Collaborate using Team Workspaces

* Requirements

* Basic programming and/or JavaScript knowledge is required (needed for writing tests)
* Basic HTTP knowledge required (address
* message body
* headers
* cookies
* ...)
* Basic knowledge about RESTful APIs and JSON
* Basic Jenkins experience
* if an integration with Jenkins is desired
* Basic NodeJS/NPM experience (needed for test automation)
* Optional - Basic Docker experience (for Jenkins or Newman)
* A computer with Windows
* macOS or Linux is required for viewing the lectures and installing Postman. Using a mobile phone/tablet is not recommended.
* Registering to a few reputable public APIs is required for you to be able to follow along with the course

Description

  • Create GET, POST, PUT, DELETE request
  • Understand GET vs POST request method
  • Work with real-world APIs (Github API, Trello API)
  • JavaScript basics for tests
  • Write API tests in Postman
  • Use data from Excel files (CSV) or JSON
  • Use Postman variables to create workflows and scenarios
  • Run API tests with Newman in Jenkins, GitLab CI or TeamCity
  • Use OAuth2, API keys, tokens, JWT, basic auth
  • Test file uploads
  • Use mock servers
  • Collaborate using Team Workspaces

Course content

19 sections • 153 lectures

Course overview Preview 04:20

In this lecture, I wanted to give you an overview of the entire course. 

Course updates Preview 00:31

How to install Postman Preview 02:29

Introduction and first steps in Postman Preview 14:59

Introduction and first steps in Postman (continued) Preview 12:34

The Postman Landscape Preview 02:36

First steps in Postman

Let's just recap what you have learned in this lecture.

Resources for this section Preview 00:06

How to create a request in Postman Preview 03:55

A brief overview of HTTP Preview 04:59

Postman collections Preview 09:14

Query parameters Preview 11:48

Practice #1 - Query parameters Preview 01:20

Practice #1 - Query parameters - Solution Preview 04:18

API Authentication Preview 09:35

Troubleshooting HTTP status codes Preview 02:13

HTTP headers Preview 02:54

JSON format explained Preview 06:57

Practice #2 - POST request Preview 00:45

Practice #2 - POST request solution Preview 04:00

GET vs POST Preview 03:34

Troubleshooting Postman issues Preview 05:19

So the API you are calling is not working? Don’t panic and keep calm because in this lecture I will show you a couple of tips on how to troubleshoot the most common problems in Postman.

Working with API requests

In this assignment I have prepared a couple of tasks for you to solve.

How to import a request from your browser in Postman Preview 02:44

This video will show you how to easily create Postman request by importing them directly from your browser.

Introduction Preview 00:39

In this section your are going to start writing tests but at the same time explore more features of Postman such as variables and environments for adding a dynamic behaviour to your requests, workflows and scripts for more advanced scenarios.

The Postman Cheat Sheet & Quick Reference Guide Preview 00:14

Your first API test in Postman Preview 07:22

Let's write a simple test together and understand how everything works.

Resources for this section Preview 00:21

Testing an API Preview 06:47

In this and the following lectures, you will be testing a real-world API and at the same time discover more and more feature of Postman.

We will take trello.com’s API (which is an online tool for managing lists and tasks) and create and test a few requests.

Testing an API - Writing more tests Preview 07:55

Troubleshooting Preview 00:10

Recap: Path parameters vs query parameters Preview 07:17

In this tutorial, I wanted to explain the difference between path params and query params and will exemplify this in Postman.

Create additional requests and tests

Starting from the previous lecture, you will call additional endpoints using the trello API in order to create a complete workflow.

Refactoring Tests Preview 04:03

Now let's refactor the tests that we have written so far, so that they are easier to read.

Variables in Postman Preview 02:06

Variables allow you can create more dynamic requests. 

Postman allows you to save repetitive information in a variable (which is very similar to what a variable is in any programming language). The main motivation for using variables would be to not repeat yourself.

Global variables Preview 10:09

This lectures explain what are global variables and what is their scope.

Environments Preview 06:39

This lecture discusses environment variables, which are defined inside environments, are quite similar to global variables but they have a more narrower scope, which means they are more specialised.

Session variables (new in Postman 6.2!) Preview 08:13

Postman 6.2 introduces a new feature called sessions, which allows you and your team to work more effectively through the addition of session-specific collection, environment, and global variables also called session variables.

In this video, I will show you how to configure and use session variables.

Bulk editing removed new in Postman 6.2!) Preview 03:06

Bulk editing has been removed in Postman 6.2 but in this video I will show you a way on how you can achieve the same result.

Pre-request scripts in Postman Preview 09:26

This lecture deals with pre-request scripts, which are similar to test scripts except as the name implies, pre-request scripts give you a chance to modify the request but before the actual HTTP request is made. 

Make the requests dynamic by taking advantages of variables

We already have a created a few requests which are linked to each other. The goal of this exercise is to practice variables and to reduce the amount of manual work needed in order to test the API.

Understanding different variable scopes / types Preview 11:37

In case you are confused about the different variable types in Postman (global, collection, environment, local, data variables), this lecture is a good way to get an overview.

How to setup different URLs using environments in Postman Preview 08:20

In this video i will show you how to setup different URLs for different servers / environments. 

Debugging tests Preview 03:00

This lectures deals with debugging tests and scripts using the Postman Console.

Notice about the old Postman scripting API Preview 01:59

About this section Preview 01:17

This section gives you the opportunity to practice the skills you have learned so far. It uses real-world APIs to help you gain even more practical experience.

In this section lecture we will use the Github API to create a simple workflow.

We will create a new git repository, post an issue with some content, comment on that issue and so on. We will introduce 2FA authentication in the game and work with the Twilio API to receive a text message (SMS).

So if you have the time, this will be a fun project to work on.

Github API changes starting November 2020 Preview 00:40

Introduction to the Github API Preview 02:33

Create a simple workflow using the Github API

In this assignment, you will use the Github API to create a simple workflow.

Introduction to 2FA Preview 02:27

This lecture briefly explains what Two-Factor Authentication (2FA) is.

Setting up 2FA on Github Preview 02:27

Setting up 2FA in Postman Preview 04:21

Automating two-factor authentication (2FA) workflow - overview Preview 01:34

Introducing twilio Preview 01:15

Get a new Twilio phone number & 2FA setup Preview 01:00

Setting up 2FA on Github with Twilio Preview 02:26

Troubleshooting why Twilio did not receive the SMS Preview 00:57

Assignment: Read the SMS code and replace it in the workflow Preview 00:18

Using the Twillio API in Postman Preview 04:33

Conclusion Preview 04:15

Additional assignment Preview 00:25

Section overview Preview 00:41

Overview of the assertions section.

Postman assertion basics Preview 04:00

Let's understand what are the prerequisites for writing assertions. 

Chai Assertion Library Preview 01:34

Short introduction to the Chai JS assertion library used in Postman.

Assertions Preview 09:50

Chai Assertion Library

Let's make sure you have a good understanding of the basics when using the Chai Assertion Library.

Assertions on arrays Preview 14:36

In this lecture we will have a look at an example on how to make assertions on nested JavaScript objects and arrays.

Assertions on nested objects Preview 17:13

In this lecture we will have a look on how to make assertions on nested JavaScript objects.

How to write assertions in Postman (objects, arrays, nested properties) Preview 00:03

Testing headers and cookies Preview 00:17

Sometimes it is needed to test headers and cookies as well. This lecture deals with that.

Overview Preview 03:10

In this short lecture I wanted to give you an overview of what you will learn in this entire section. 

What we want to achieve is to run the entire collection (one request after another) and to get an overview of successful or failed tests. There are multiple ways to automate things and next I will give you an overview.

Postman collection runner Preview 07:38

The collection runner is included in Postman and facilitates the first step toward automation. It is a useful way to run the entire collection or just a subset of it (by selecting a specific folder) without any other external tools.

Postman monitors Preview 10:09

Postman Monitors allows you to run your collection at regular intervals. While this is a Pro feature, you can still try it out with a free account (currently you can make 1000 API calls per month).

Automating with Newman (Overview) Preview 03:46

Short introduction to NodeJs and NPM Preview 01:11

Installing Newman Preview 03:34

Troubleshooting Node.js / npm / Newman Problems (for Windows) Preview 00:48

Running a collection with Newman Preview 02:41

Newman v3 to v4 Migration Guide Preview 04:09

This video shows how you can update fro Newman v3 to Newman v4 and briefly presents what has changed.

3 ways to access your Postman collection from Newman Preview 09:03

Specifying environments with Newman Preview 05:12

Prerequisites for running Newman on Jenkins Preview 03:20

Troubleshooting Jenkins Problems (for Windows) Preview 01:07

Troubleshooting Jenkins Problems (for macOS, Linux) Preview 00:08

Running a collection with Jenkins and generating a report Preview 12:32

Creating an HTML report in Jenkins Preview 03:20

Generating better HTML reports Preview 06:35

This lecture explains how you can use a 3rd party reporter to generate nicer HTML reports.

Customizing HTML reports Preview 05:18

This lecture looks into customizing HTML reports generated by Newman.

Troubleshooting HTML reports Preview 00:21

Running a collection from a Git repository with Jenkins Preview 02:53

Gitlab CI Preview 12:28

In this lecture explains how you can use Gitlab CI to automate the execution of Postman tests. It will be using the official Newman Docker image.


TeamCity Preview 21:26

This videos deals with running Postman tests in TeamCity with the help of Newman.

Short introduction to Docker (optional) Preview 04:42

Short introduction to Docker.

Running Jenkins with Docker Preview 00:35

Running Newman with Docker Preview 05:38

Overview Preview 00:51

Creating a basic workflow / scenario Preview 06:00

Advanced workflows Preview 06:57

Clearing unused Trello boards

In the previous sections, you have created a lot of boards what you probably do not need anymore and where you no longer have the IDs in order to delete them. Notice: This step requires some JavaScript know-how to complete. Let's have a look if we can a solution to this problem.

Multiple workflows with the same collection Preview 00:05

Using workflows to create data-sets Preview 09:22

In this video I will show you how you can take advantage or pre-request scripts and workflows to submit the same request over and over again but with different data each time.

Using external data files - Basic usage Preview 08:03

In this lecture you can learn the basics of using external data files to generate multiple iterations in Postman.

Using external data files - Writing tests Preview 07:59

In this lecture continues the previous lecture and shows how to adapt the tests and scripts when using external data files and data variables.

Using external data files - Advanced usage Preview 09:10

In this lecture continues the previous lectures and shows more advanced use-cases for data variables and iterations.

Introduction Preview 00:44

Workspaces provide a way to organise Postman collections in order to make it easier to manage. Team workspaces allow you to collaborate on a number of collections with other team members in a seamless way.

Anytime somebody makes a change, this will be reflected in your Postman App almost instantly.

Using the Git version control system - Overview Preview 06:05

This lectures gives an overview on how you can share you Postman collection by using Git.

Using the Git version control system - Hands on Preview 08:09

This lectures shows you hands-on how you can share you Postman collection by using Git.

Team Workspaces - Creating and sharing a workspace Preview 08:27

In this lecture we will go over the basics of team workspaces, will create a team workspace, add a collection and invite others to collaborate on it.

Team Workspaces - Understanding users and permissions Preview 03:32

This lectures explains the basics of teams, users, workspaces and permissions when using Team workspaces.

Team Workspaces - Managing user permissions Preview 04:15

This lecture explains how to manage permissions when using Team Workspaces.

Introduction to mock servers Preview 00:37

What is a mock server? A mock server is a fake API that simulates a server response, usually for testing purposes. A mock server allows you to mock any server or service that can be accessed by using HTTP.

Why use a mock server? Preview 05:39

Let's first understand what are the use-cases for using a mock server:

  • API Design, prototyping and development (1)

  • API testing (2)

Create your first mock server Preview 11:44

Learn how to create your first mock server with Postman.

Practical example: using mock servers for front-end development Preview 04:32

I have an Angular application which needs to data from the backend which is not ready yet. Using mock server I will demonstrate how to continue with the development.

Recording responses from an existing API Preview 04:41

Known limitations Preview 02:09

As with any software tool, there are always limitation or disadvantages. So let's what a look at what you should be aware of.

Sending and testing multipart/form-data requests (file upload form) Preview 10:00

In this lecture I will show you how to debug an upload script and demonstrate it with Postman which can also make requests encoded as "multipart/form-data" so that you can send also a file.

Automatic the upload and testing process with Newman Preview 16:57

We continue the file upload project and move towards automatically running tests by using Newman. 

We will also look into uploading multiple files in a single test-run.

Basic access authentication Preview 05:55

Basic access authentication is a method in which the client provides a username and password while making a request to a protected resource.

Basic authentication is one of the simplest methods of implementing authentication.

I recently encountered it while dealing with microservices, so it is old and simple but still effective.

OAuth2 Authorization Flow (Authorization Code Grant) Preview 07:54

This lecture shows you how you can test the OAuth 2.0 Authorization Code Grant using Postman.

Form-based / Session-based authentication Preview 16:25

Learn how to login to legacy systems which are using a form-bases / session-based / cookie-base authentication. Additionally, I will show you how do deal with more complex scenarios which involve CSRF tokens.

JSON Web Tokens (JWT) Preview 09:34

Postman help - Schedule your free Postman consultation Preview 00:24

You ask, I answer Preview 00:14

Reusing tests in multiple requests Preview 09:19

This lecture explains how you can adhere to the DRY principle and re-use existing tests.

How to deal with CSV responses? Preview 09:34

In this video, I will show you how to deal with responses in CSV format in Postman.

Writing files to the file system Preview 30:50

This lecture will tackle the delicate topic of writing files to the disk while using Postman. This will be possible by actually running Newman as a Node module.

Passing variables dynamically to the request at runtime (Newman) Preview 00:18

Sending requests from scripts Preview 13:19

How can I connect to my database using Postman? Preview 06:06

JSON Schema validation in Postman Preview 00:12

Designing APIs with Postman (OpenAPI 3.0.0 / Swagger) Preview 12:37

Sending GraphQL Queries in Postman Preview 08:20

Section overview Preview 01:52

A short history of JavaScript Preview 01:45

Data Types in JavaScript Preview 11:17

Data Types in JavaScript

Variables Preview 07:25

Variables

Conditionals Preview 09:52

Conditionals

Functions Preview 13:02

Generate a random email address

Data structures: arrays Preview 07:52

Data structures: objects Preview 10:31

Loops Preview 07:36

Modern JavaScript Preview 07:58

Sorting things out

Applying what you have learned to Postman Preview 06:47

Conclusion Preview 01:18

What are you learning next? Preview 00:12

Bonus Lecture Preview 00:18