BreadcrumbHomeResourcesBlog What Is Postman? How To Use Postman To Test APIs March 24, 2020 What is Postman? How to Use Postman to Test APIsAPI TestingBy Jacob SharirThis blog will give a step-by-step guide on how to do Postman API testing in order to simplify the API testing process. APIs make it possible for any two separate applications to transfer and share data between them. They also make it easier for an application's users to execute actions without having to use the application’s GUI. From the developers' POV, it's an easy way to execute certain functionalities of their app and test it as well.Using APIs on a daily basis might become cumbersome, as one might have dozens or even hundreds of APIs that he or she needs to use or test. That makes it difficult to keep up with their exact request’s address(es), header(s), authorization credential(s) etc. And it makes it harder to test the API for functionality, security, and exception handling.Table of ContentsWhat is Postman?Why Use Postman API Testing?How to Use Postman to Test API How to Create Postman Collections for Sharing BlazeMeter's APIRunning a Postman Collection Using Collection RunnerUsing APIs Within Your Own App or Script With PostmanTable of Contents1 - What is Postman?2 - Why Use Postman API Testing?3 - How to Use Postman to Test API 4 - How to Create Postman Collections for Sharing BlazeMeter's API5 - Running a Postman Collection Using Collection Runner6 - Using APIs Within Your Own App or Script With PostmanBack to topWhat is Postman?Postman is an API client that makes it easy for developers to create, share, test and document APIs. With this open-source API testing tool, users can create and save simple and complex HTTP/s requests, as well as read their responses. To successfully run Postman API tests, you need to get Postman installed by downloading it and installing it here.🚀 Try BlazeMeter today for 360° API testing >>Back to topWhy Use Postman API Testing?There are many benefits to using open-source Postman for API testing, including: Accessibility from the cloud. When you are signed into your account, you are able to access your files. You can execute Postman API tests anytime, anywhere.Collaboration. Postman's import and export capabilities make it easier to share files with other team members, enabling closer collaboration. Test Creation. You can add test checkpoints such as verifying successful HTTP response statuses to your Postman API calls. This capability can help teams achieve more comprehensive test coverage. Automated API Testing. With features such as Collection Runner, you can automate Postman API tests, saving time and resources. Simpler debugging. The Postman console makes it easier to debug API tests by helping teams check the retrieved data. Collections. Postman's Collections features enables teams to group together multiple related APIs, which helps with organizing test suites.Upgrade your API testing and monitoring with BlazeMeter — the testing solution preferred by developers.Start Testing NowBack to topHow to Use Postman to Test API Postman is very convenient when it comes to executing APIs. Once you’ve entered and saved them, you can simply use them over and over again, without having to remember the exact endpoint, headers, or API keys.Here is a detailed example explaining how to enter a new API request using BlazeMeter’s ‘test create’ API, but you can do this for the product you are developing:Launch Postman by clicking on the logo. After it completely loads the main screen, follow these steps to create your collection of requests:On the “collections” tab click on the “+” button to create a new collection. A new collection will appear and you will be able to edit its name, description, and many other settings.2. Then right click on that new collection and select “add request” to create your first request.3. Select the recently created request and enter the API endpoint where it says ‘Enter request URL’ and select the method (the action type) on the left of that field. The default method is GET but we will use POST in the example below.4. Add authorization tokens/credentials according to the server-side requirements. The different methods/protocols Postman supports are: No Authentication Basic Authentication (provide username and password only) Digest Authentication OAuth 1.0 OAuth 2.0 Hawk Authentication AWS Signature NTLM Authentication [Beta]5. Enter headers in case they are required.6. Enter a POST body in case it is required. In this example, we are creating a BlazeMeter test that requires a JSON payload with relevant details.7. If you wish to execute this API now, hit the ‘Send’ button, which is located to the right of the API request field. You can also click on the ‘Save’ button beside it to save that API request to your library. That's it! Now you know how to enter your API request to Postman and save it to your library.Back to topHow to Create Postman Collections for Sharing BlazeMeter's APIOne of Postman's fantastic features is Collections. Collections allow you to group together several APIs that might be related or perhaps should be executed in a certain sequence.For example, in the previous screenshot, you can see a collection that includes 4 APIs that are all required to create and run a BlazeMeter test. The first two APIs create the test object - the first of the two applies the necessary configuration, and the following API uploads the script file needed to run it. The last two APIs start and stop the test we created previously. Obviously, they should be executed in that sequence, hence the collection will be sorted accordingly.Back to topRunning a Postman Collection Using Collection RunnerIn order to run a Postman Collection, you will need to use a feature called ‘Collection Runner’ following this steps:1. In the Postman GUI, in the bottom right corner of the screen, click the ‘Runner’ button.2. Drag and drop the desired collection or folder to the runner window. In our case, it will be the collection called BlazeMeter API.3. There are additional configuration parameters that you may define. However, this is not mandatory. For example, you can specify the number of iterations you wish to run the collection for, as well as add delays between each API request. There is also an option to choose your ‘Environment’. Environments allow you to customize requests using variables that might include environment-specific values. This is extremely helpful when you are testing against several environments, like the development environment, the production environment, etc. To set up a new environment, click on the eye icon on the top right side of the Postman GUI and select ‘add’. You will be able to add a new one as well as its respective variables.Back to topUsing APIs Within Your Own App or Script With PostmanPostman also has a feature called ‘Snippets’. You can use it to generate code snippets in a variety of languages and frameworks, such as Java, Python, C, cURL and many others.This is a huge time saver. A developer can easily integrate APIs with his or her own code without too much hassle. To use it, click on the code tab on the right side of the screen of Postman’s GUI.Get the most out of your APIs with API testing and monitoring with BlazeMeter. Start testing with the industry leader for FREE today!START TESTING NOW Related ResourcesOpenAPI vs. Swagger: 5 Reasons You Should Use BothWriting Python API Tests with ApiritifBack to top
Jacob Sharir Domain Expert Jacob Sharir is a BlazeMeter domain expert, with more than 7 years of experience in performance testing, test automation, and respective open-source frameworks. While leading a global team of technical experts, Jacob is proficient in the fields of Continuous and Performance testing. He is focused on assisting the Product team with exploring creative solutions, and increasing products’ value, quality and stability while helping customers improve their testing efficiency.