๐งช What is API Testing?
API Testing is the process of verifying whether APIs work as expected — focusing on functionality, reliability, performance, and security.
Unlike UI testing, it doesn’t involve a browser or frontend.
Instead, you directly send requests (GET, POST, PUT, DELETE) and validate responses (status codes, response time, and data).
Key checks during API testing:
-
✅ Is the response status code correct? (e.g., 200, 404, 401)
-
✅ Is the response time within the limit?
-
✅ Are all fields and data types correct?
-
✅ Is authentication/authorization working properly?
-
✅ Are error messages meaningful?
⚙️ How to Perform API Testing?
You can perform API Testing using manual tools or automation frameworks.
๐น Manual API Testing
Tools like Postman, Swagger, or Insomnia help testers send requests and analyze responses without writing code.
Basic flow:
-
Launch Postman
-
Create a new request
-
Enter the API endpoint (URL)
-
Select the method (GET/POST/PUT/DELETE)
-
Add headers or authentication if needed
-
Click Send
-
Validate the response body, status code, and time
๐น Automated API Testing
Automation tools like:
-
RestAssured (Java)
-
Requests + Pytest (Python)
These help run regression suites, integrate with CI/CD (Jenkins, GitHub Actions), and generate reports automatically.
๐ Types of APIs
| Type | Description | Example |
|---|---|---|
| Open APIs (Public APIs) | Available to everyone; used by third parties. | Google Maps, OpenWeather API |
| Internal APIs (Private APIs) | Used only within an organization for internal systems. | HRMS ↔ Payroll System |
| Partner APIs | Shared between specific business partners; require access tokens. | Travel site ↔ Airline partner |
| Composite APIs | Combine multiple endpoints in one call. | Fetch order + shipping + payment info in one response |
๐ Quick Recap
✅ API = Communication Bridge between two systems
✅ API Testing = Validating request & response
✅ Can be done manually (Postman) or automated (RestAssured, Python, etc.)
✅ Focus on status codes, response data, time, and security
✅ APIs can be Public, Private, Partner, or Composite
๐ง Pro Tip
Start practicing with free APIs like:
๐น https://reqres.in
๐น https://jsonplaceholder.typicode.com
๐น https://dummyjson.com
These are perfect for learning GET, POST, PUT, DELETE methods.
No comments:
Post a Comment