Can someone tell me the basic test cases for testing an API with Postman?
- Which test cases are commonly applied in API Testing.
Note: I am a beginner and I don't know where to start.
Well it is an era of API Testing, Rest APIs in particular. I would recommend you to know the basics of Restful before you proceed to testing of different sorts.
Some basics that you need to learn before you plunge into Rest API testing:
Once you're done with the aforementioned, you can pretty much apply your testing skills to test out APIs using any tool. Postman is a good one to start, Thanks!
Postman is one of the most easy to use tools that you can use for both manual and automated testing of RESTful API's. A sample test case for Postman would be as simple as having to hit a uri endpoint, fetching the results and asserting that the response code received is of HTTP 200.
You can go on with complexities like asserting the JSON/HTML/XML responses and integrate it with Jenkins for CI purposes.
I have experience of using Postman to build a completely CI automated API Test Framework using Postman, Postman BDD assertion library, Jenkins.
I have covered the basic part of using Postman in the first part here.
With Postman, you can create different kinds of HTTP requests such as GET, POST, PUT, PATCH and DELETE. It also provides supports for adding headers in the requests. It’s a very convenient API tool with very useful features.
As, Postman is very fast in response and also light weight that puts no impact on browser performance. Tests can be created with verification for certain conditions on the response.
Check out this step by step process to perform API testing through Postman:
First, install ‘POSTMAN’ add on in Google Chrome.
Click on ‘Create New Collection’ button, fill details and Click ‘Create’ button.
Now go to newly created Collection and then Create
Read detailed process in this blog: How to perform Automation Testing of APIs using Postman?
Postman is a tool that I use to test API calls before I put them into my code base. This is because I want to see what error messages and status codes the call itself causes. Once the API call is working as intended then I will put it into my code.
Basically, I want to make sure the API call is correct before I put it into the code base. This one foot in front of the other approach eliminates the guesswork of trying to figure out if the call itself was wrong or if my implementation of it into the code base caused an issue.
Postman also will provide meaningful feedback that sometimes gets gobbled up when you make an API call through a program.
Instead of using Postman I recommend you to use JMeter. It is a powerful tool for API/functional testing too.
Since you are testing APIs, you need to consider the server side validation along with other business logic.
For more information, Please elaborate your requirements in question description.