0% found this document useful (0 votes)
10 views1 page

API Test Cases Postman

The document outlines common test cases for API testing using Postman, focusing on the login and user information retrieval scenarios. It specifies various request types, expected responses, and status codes for valid and invalid login attempts, as well as access control for user information. Key scenarios include valid login, invalid password, empty fields, user not found, token expiration, and unauthorized access without authentication.

Uploaded by

Riasad Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

API Test Cases Postman

The document outlines common test cases for API testing using Postman, focusing on the login and user information retrieval scenarios. It specifies various request types, expected responses, and status codes for valid and invalid login attempts, as well as access control for user information. Key scenarios include valid login, invalid password, empty fields, user not found, token expiration, and unauthorized access without authentication.

Uploaded by

Riasad Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

API Testing with Postman – Common Test Cases

Scenario Request (Example) Expected Response

POST /api/login Status: 200 OK


Valid Login Body: {"username":"testuser","password":"123456"}
Response: {"status":"success", "token":"abc123xyz"}
POST /api/login Status: 401 Unauthorized
Invalid Password Body: {"username":"testuser","password":"wrongpass"}
Response: {"status":"error", "message":"Invalid crede
POST /api/login Status: 400 Bad Request
Empty Fields Body: {"username":"","password":""} Response: {"status":"error", "message":"Fields requir
POST /api/login Status: 404 Not Found
User Not Found Body: {"username":"wronguser","password":"123456"}
Response: {"status":"error", "message":"User does n
GET /api/userinfo Status: 401 Unauthorized
Token Expired Header: Authorization: Bearer <expired_token>
Response: {"status":"error", "message":"Token expire
GET /api/userinfo Status: 403 Forbidden
Access Without Auth (No Authorization header) Response: {"status":"error", "message":"Access deni

You might also like