API testing is a critical skill for modern developers and QA engineers. Whether you're working with RESTful services or GraphQL, having a solid testing strategy ensures your APIs are reliable, secure, and performant. In this cheatsheet, I'll cover everything from HTTP methods to best practices for automation.
pm.test("Status code is 200",function (){pm.response.to.have.status(200);});pm.test("Response contains userId",function (){varjsonData=pm.response.json();pm.expect(jsonData.userId).to.not.be.undefined;});
10. Best Practices
Use data-driven testing (CSV, JSON, Excel)
Modularize test cases & reuse headers, base URIs
Add setup & teardown APIs if needed
Include logging for requests/responses
Integrate with CI/CD (Jenkins, GitHub Actions, etc.)
Keep test data clean, isolated, and resettable
11. Reporting Tools
Extent Reports – Rest Assured + TestNG
Allure Reports – Java/Karate/Cucumber
Newman HTML Reporter – For Postman automation
Jenkins Test Results – For CI visibility
12. Common Libraries
Tool
Language
Use Case
Rest Assured
Java
API Automation Framework
Postman
JS
Manual + Automated API tests
Karate
Java
BDD + API + UI combo tests
Supertest
JS
Node.js API testing
Requests
Python
Lightweight API testing
13. Handy Tips
Always test both valid and invalid inputs
Use environment variables for base URLs and tokens
Create collections and group related tests
Use data-driven testing for multiple test cases
Add delays/assertions to handle async processing
This cheatsheet covers the essentials of API testing, but remember that every project has unique requirements. What are your favorite API testing tools or techniques? Share in the comments below!
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)