API Testing using Postman & Newman

Why API testing?

Installation

Start testing with Postman

* A sample Swagger Dokumentation
* A sample folder structure inside Kurt-Desk-Booking Collection
* Different environments
* An example of using variables
* Query parameters

Approach of API Testing

  1. Verify correct HTTP status code. For instance, creating a resource should return 201 CREATED, and unpermitted requests should return 403 FORBIDDEN, etc.
  2. Verify response payload. Check valid JSON body and correct field names, types, and values — including in error responses.
  3. Verify response headers. HTTP server headers have implications on both security and performance.
  4. Verify basic performance sanity. If an operation was completed successfully but took an unreasonable amount of time, the test should fail.
  • Basic positive tests (Happy path)
  • Extended positive testing with optional parameters
  • Negative testing with valid input
  • Negative testing with invalid input
  • Destructive testing
* A typical example of one simple test case
* An example of positive test cases.
* Usage of Pre-request script

Data Driven Testing

Newman

npm install -g newman-reporter-htmlextra
* Exporting a collection as JSON file

Conclusion

--

--

--

Inquisitive person by nature, technology fancier, and quality assurance provider. Eager to learn more on test automation.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Express Authentication

SQL Joins

Coherence VisualVM Plugin 1.2.0 Released

Top 10 best PHP Frameworks for Web Application Development

Deploy to Production Server with Git using PHP

HackTheBox — Forge

Implementing Real-Time Transcription in an Easy Way

Building Simple Python CLI with glacier

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ekrem Kurt

Ekrem Kurt

Inquisitive person by nature, technology fancier, and quality assurance provider. Eager to learn more on test automation.

More from Medium

How to make a test using Serenity BDD?

Live Cross Browser Testing and Debugging On Safari Browser

How to schedule jobs using GitHub Actions

API Testing with POSTMAN