
Why do we need to test API?
1. Verify functionality.
2. Open to the public. So there is a risk for unwanted data access or system modification.

What can we use Postman for during API testing?
1. Make API calls (manual/automated)
2. Assert responses using Javascript
3. Organize tests
4. Integrate tests with integration tools
Advantage comparing to UI automation
1. Faster
2. More stable
Postman Skills
- Collections and folders. They are collections of API requests. It is a good way to manage tests and share with co-workers.
- GET requests. Retrieving data.
- POST requests. Publishing data.
- PUT requests. Updating data.
- DELETE requests. Removing data.
- Negative responses. To trigger negative responses, consider scenarios such as wrong url or missing parameter or illegal character, etc..
- Common error codes:
400 bad request; 401 unauthorized; 403 fobidden; 404 not found; 500 internal server error; 503 service unavailable; 504 timeout...
- Environment variables. Like variables in programming languages, they are used to avoid repetition and increase efficiency. They may be defined manually or extracted and set automatically.
- Status code assertion. E.g. to.have.status()
- Body assertion. E.g. text().to.include("")
- Header assertion. E.g. to.have.header("")
- Response time assertion. E.g. response.responseTime.to.be.below()
- Debugging with the console.
- JSON assertion. E.g. response body JSON value check
- Nested JSON assertion. Just include the path of the element you are asserting.
- JSON structure. An object is a collection of name-value pairs; an array is a group of objects.
- Running test collections as a group.
- Automating the test collections with NodeJS and Jenkins