Tuesday, March 17, 2020

POSTMAN

What is Postman?
Postman is currently one of the most popular tools used in API testing. It started in 2012 as a side project by Abhinav Asthana to simplify API workflow in testing and development. API stands for Application Programming Interface which allows software applications to communicate with each other via API calls.

Why Use Postman?
Here are some reasons we should use Postman and Newman for API testing.

1. Easily create test suites
Postman allows you create collections of integration tests to ensure your API is working as expected. Tests are run in a specific order with each test being executed after the last is finished. For each test, an HTTP request is made and assertions written in javascript are then used to verify the integrity of your code. Since the tests and test assertions are written in JavaScript, we have freedom to manipulate the received data in different ways, such as creating local variables or even creating loops to repeatably run a test.
2. Store information for running tests in different environments
You wrote your test collection and it all works perfectly. You can run it again and again against your local environment and every test passes every time. But your local environment is usually configured a little differently than a test server. Luckily, Postman allows you to store specific information about different environments and automatically insert the correct environment configuration into your test. This could be a base URL, query parameters, request headers, and even body data for an HTTP post.
blog_pic_2.png
3. Store data for use in other tests
Postman also allows you to store data from previous tests into global variables. These variables can be used exactly like environment variables. For example, you may have an API that requires data received from another API. You can store the response (or part of the response, since it is JavaScript) and use that as part of a request header, post body, or URL for the subsequent API calls.
4. Automation Testing: Through the use of the Collection Runner or Newman, tests can be run in multiple iterations saving time for repetitive tests.
5. Debugging: Postman console helps to check what data has been retrieved making it easy to debug tests.
6. Continuous Integration: With its ability to support continuous integration, development practices are maintained.
7. Integrates with build systems, such as Jenkins using the Newman command line tool
Postman has a command line interface called Newman. Newman makes it easy to run a collection of tests right from the command line. This easily enables running Postman tests on systems that don’t have a GUI, but it also gives us the ability to run a collection of tests written in Postman right from within most build tools. Jenkins, for example, allows you to execute commands within the build job itself, with the job either passing or failing depending on the test results.
blog_pic_5.pngMore Details about POSTMAN use this link https://www.guru99.com/postman-tutorial.html

  1. What is Postman?
  2. Why Use Postman?
  3. How to use Postman
  4. Working with GET Requests
  5. Working with POST Requests
  6. How to Parameterize Requests
  7. How to Create Postman Tests
  8. How to Create Collections
  9. How to Run Collections using Collection Runner
  10. How to Run Collections using Newman

Featured Posts