So you have an interest in using Postman as your API Testing tool?
Awesome! But before we begin, please be sure to read my blog on Postman found here.
Let’s get started! First, navigate to my tutorials github repository and download the project.
Here is a very basic Postman tutorial for testing and training purposes. This repository contains the following files: The Postman Collection(PostmanTutorial.postman_collection
), The Data File( postman.data.json
), and this ReadMe
file.
Requirements:
Instructions:
- Download/Clone this repository.
- In a new Terminal window, navigate to your newly downloaded/cloned
postman-tutorial
project.
Running the Collection:
- In a new Terminal Window, Navigate to the folder containing the
PostmanTutorial.postman_collection
and thepostman.data.json
files. (cd into the project directory). - Run $
newman run PostmanTutorial.postman_collection --insecure -d postman.data.json
Editing the Data Tested:
- Open the
postman.data.json
file in your preffered IDE, notepad or terminal window. - Make edits, save, and ReRun the collection.
Editing Tests:
- Open Postman
- Once Postman is open, On the Top Navigation Bar, click
Import
- Import the
PostmanTutorial.postman_collection
file. - Navigate to your newly imported
PostmanTutorial
collection in Postman. - Click Tests to view the Tests for the collection.
- Click Save to save your changes.
- Hover over your Postman Collection name and click the three dots (…)
- Cick Export
- Select the Collection v2 option and click Export
- Save to the same folder location and overwrite
PostmanTutorial.postman_collection
. - Run your Collection.
Generating Run Reports:
- Install newman html reporter by doing a $
npm install -g newman-reporter-html
in a terminal window.
Usage:
In order to enable this reporter, specify html in Newman’s -r
or --reporters
option.
- Example: $
newman run PostmanTutorial.postman_collection --insecure -d postman.data.json -r html