What is Postman?
- Postman is the collaboration platform for API development.
- Postman simplifies each step of building an API and streamlines collaboration so you can create better APIs-faster.
- Postman started simply as a side project to solve a specific problem: Abhinav Asthana, Postman's CEO and co-founder, set out to create a tool that would simplify the API testing process.
- As the tool’s usage quickly exploded, Abhinav recruited two of his former colleagues, Ankit Sobti and Abhijit Kane, to help him create Postman, Inc.
- Postman is now the world's leading collaboration platform for API development, and the three founders still lead the company to this day.
Key Features of Postman
- Create, Import or Export Requests in Postman
- Create, Import or Export Collections
- Test Scripts using the Postman Sandbox
- JSON Schema Validation
- Leverage Postman BDD
- Control Test Workflows
- Variables (Environment & Dynamic)
- Collaboration
- Monitoring
- API Platform
- Mock Server
- Documentation
- Manage Team
Resource URL: https://www.postman.com/postman-features
1. Import Requests to Postman
- You can Import different kind of a file formats by navigating to File -> Import Option or by simply click on Import button in the Postman Application.
- It basically allows any of these file formats:
- Open API, RAML, GraphQL, cURL, WADL
- It has provided different options to import Request such as file, folder, link, raw text or as a code repository.
- After successful Import, you’ll be ready to work with the API endpoint with Postman API.
- Further more you can simply copy a pending or completed request from the Web browser’s Network tab and able to simply import it a any of the above formats also.
2. Create Collections
- Another one of the most interesting feature of using Postman which helps to maintain API endpoints as separate collections for better usability by organizing and keep in track of related requests.
- Simply a Collections are executable API descriptions.
- You can create a collection by click on the (+) icon under “Collection” menu option or by simply click on new button and select option “Collection” as mentioned in the below screenshot.
- They can be used for different perspectives such as:
- Add or Remove a Request to a Collection
- Restore collection to a previous state
- Import Collections
- Export Collections
- Organize and keep track of related Requests
- Share collections to workspaces
- Run collection in Collection Runner
3. Export Collections
You can simply export a particular collection by click on the Export option from the drop down displayed under the Collection.
4. Test Scripts and the Postman Sandbox
- We can use scripts such as Test Cases which helps us to check and confirm whether we are receiving (Actual Result) the correct result by compared to the Expected Result.
- What is Postman Sandbox?
- Postman Sandbox is a JavaScript Execution environment that available to you while writing pre-request scripts and test scripts for requests (for Both Postman and Newman).
5. JSON Schema Validation
- We can use a specific JSON schema to define the structure of their requests and responses.
- What is JSON? JSON simply stands for Java Script Object Notation. And it is a lightweight format for storing and transporting data. It’s “self-describing” and easy to understand.
- JSON Schema is a contract for your JSON document that defines the expected data types and format of each field in the response.
- It describes your existing data format with clear, human and machine readable documentation for complete structural validation which may useful for automated testing and validating client-submitted data.
- But why we need JSON Schema Validation?. So here is why:
- Using JSON Schema we can make it easier to validate whether our API is returning the data as it should (as expected).
- To monitor your API responses by ensuring whether they are according to a specific format.
- Get altered when braking changes occur.
- Generate a JSON schema by simply going to https://jsonschema.net
- Object Assertions and check REQD properties to make each element in the JSON to become mandatory.
- Number Assertions and check user number, not integer for all numeric instances.
- Finally, configure and test using Postman.
6. Leverage Postman BDD
- Postman allows you to use BDD syntax to structure your test cases.
- What is BDD? BDD stands for Behavior Driven Development.
- BDD is all about the collaboration between teams. It builds a common understanding between the business teams and the technical teams on the common behavior of the application by bridging those parties together.
- BDD process generates a common documentation that could be understood by all the teams and the stockholders.
URL Resources : https://dummy.restapiexample.com/
7. Control Test Workflows
- Postman allows you the feature to change the sequence of the test cases in certain conditions by controlling the flow of the execution.
- You can simply use postman.setNextRequest() to perform this task.
0Comments