



The image below shows that response: ( Large preview) 2. So I would open the request on the sidebar called home you can see it’s a Get request and by simply pressing Enter, I would send a GET request to the web service to see what it responds with. Our first test is to test the home endpoint( /) of the API. So my postman would look like this: ( Large preview) You will also have access to the collection if you imported it from above. I will open Postman and switch over to a workspace I created called demo which has the postman-test-demo-service collection. Now let’s follow my four steps to automating API tests in Postman. !p & (p = function () (window, document, "_pm", "PostmanRunObject", "")) I have created and organized the endpoints for the demo service that we will be using in this article in a Postman collection so you can quickly import the collection and follow along. /listing/new - Creates a new listing(a listing is details of a property owned by the user) for an existing user./user/signin - Signs in an exiting user.Understand the response returned by the API įor this article, I have a NodeJS web service powered by SailsJS that expose the following endpoints for:.When writing API tests in Postman, I normally take a four step approach: It will also allow you to move quickly and add new features because you can simply run the test cases to see if you break anything along the way. Setting up automated API tests to test the different endpoints in your API will help catch bugs as quickly as possible. If you are building APIs as a backend for a single frontend application or you are building APIs to be consumed by several services and clients, it’s important that the APIs work as expected.
#Api postman tutorial software
Testing in software development is used to ascertain the quality of any piece of software. However, it also has the ability for you to automate these tests by writing JavaScript assertions on your API endpoints. Postman allows you to manually test your APIs in both its desktop and web-based applications. With that said, as a backend or front-end developer being able to test these APIs with ease and more efficiently will allow you to move quickly in your development lifecycle.
#Api postman tutorial how to
In case you don’t know what Postman is or you are entirely new to Postman, I will recommend you check out the Postman getting started documentation page and then come back to this article to learn how to automate testing your API with Postman.ĪPIs or Web APIs pretty much drive most of the user-facing digital products. So if you are like me and you use Postman and you are tired of manually testing your APIs, this article will show how to harness the test automation feature provided by Postman. One of my favorite features in Postman is the ability to write automated tests for my APIs. In order to follow along to this tutorial, you’ll need at least a fair amount of familiarity with Postman. In this article, we will learn how to write automated tests on web APIs with Postman.
