Blog Archive

Tuesday, 30 June 2020

Postman API Testing in One Page

Post Letter, Mail Box, Letter Boxes, Letters, Mailbox

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. 

Testing Asynchronous APIs with Postman - devdone - Medium

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

  1. Collections and folders. They are collections of API requests. It is a good way to manage tests and share with co-workers. 
  2. GET requests. Retrieving data. 
  3. POST requests. Publishing data. 
  4. PUT requests. Updating data. 
  5. DELETE requests. Removing data.  
  6. Negative responses. To trigger negative responses, consider scenarios such as wrong url or missing parameter or illegal character, etc.. 
  7. Common error codes:
    400 bad request; 401 unauthorized; 403 fobidden; 404 not found; 500 internal server error; 503 service unavailable; 504 timeout...
  8. 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. 
  9. Status code assertion. E.g. to.have.status() 
  10. Body assertion. E.g. text().to.include("")
  11. Header assertion. E.g. to.have.header("") 
  12. Response time assertion. E.g. response.responseTime.to.be.below()
  13. Debugging with the console. 
  14. JSON assertion. E.g. response body JSON value check
  15. Nested JSON assertion. Just include the path of the element you are asserting. 
  16. JSON structure. An object is a collection of name-value pairs; an array is a group of objects. 
  17. Running test collections as a group. 
  18. Automating the test collections with NodeJS and Jenkins





Software Testing Tools

There are various software testing tools available for QAs to increase efficiency, visibility, accuracy, and ability of their work. The tool...