API Testing – Running Postman collection in the Docker

Most of the time people have the issue with installing software and dependencies. For example, we want to

Schedule the collection of the postman that we have created earlier using ‘POSTMAN’ tool, Rather than installing ‘newman’ command line tool, We will use a Docker image of Linux box with already installed ‘newman’.

I have been asked why I am getting the error, ‘newman’ not working etc, my os/system is having an issue while installing or running. This post definitely help you guys.

Understanding docker

Docker allows you to package an application with all of its dependencies into a standardized unit for software development.

In simple sentence consider it as a virtual machine which has ubuntu running with ‘newman‘ installed already.

Installing docker.

Navigate to the https://www.docker.com/products/overview#/install_the_platform. And Install it.
When you run it this is how it look like in Mac.






Pulling the docker images(Make sure you have the Docker install and started it)

  • docker pull postman/newman_ubuntu1404

Running postman collection using docker Command-line.

  •  docker run t postman/newman_ubuntu1404 url=“https://www.getpostman.com/collections/8a0c9bc08f062d12dcda”

Getting results.



API Testing using POSTMAN – Advance Test Cases

In this tutorial, We are going to write some TESTCASES in the POSTMAN Chrome as a part of API Testing.

API Testing includes

1. JSON Schema Validation
2. Response Time Verification
3. Verification of the Keys defined in response by API
4. Values as Expected (Data driven Testing) in response

Learn about JSON Schema – http://jsonschema.net


Code  – 
URL –  https://jsonplaceholder.typicode.com/posts/1

Test Code  –