The Student Management API for managing student records. This Postman project covers the end-to-end testing of its core functionalities, from creating a new student to deleting their records. The tests are built to verify the API's logic, response accuracy, and status codes. It's evaluating the APIs are working functionality and usability as expected.
- Install Postman.
- Install Node.js.
- Download Project file.
- Now Import collection & environment file into Postman:
file > import > choose the method > press 'import' - Run Desired API request
Run on cmd
- Open cmd on project folder or move to project folder
cd Downloads/project_file - Run the follwing command
Install newman
npm install -g newman - Now
newman run Student_Management.postman_collection.json -e Std_Manage.postman_environment.json - If want to export test results
first install them
npm install -g newman-reporter-html
andnpm install -g newman-reporter-htmlextra - Now run follwing command for report
newman run Student_Management.postman_collection.json -e Std_Manage.postman_environment.json -r cli,htmlextra
HTTP status code are 3 digit number which a server response to a browser’s request. Those are divided into 5 categories.
1xx - Informational Purpose
2xx - Success
3xx - Redirection
4xx - Client Errors
5xx - Server ErrorsThis project is designed to test the complete lifecycle of a student record in the database through a series of chained API requests. The collection follows a logical sequence to ensure data integrity and proper API functionality.
- Create a New Student: A POST request is sent with student details to create a new record.
- Validate Creation: The studentId from the creation response is automatically extracted and saved to an environment variable.
- Retrieve & Verify: GET and PUT requests use this studentId to fetch, verify, and update the newly created record.
- Clean Up: A DELETE request uses the same studentId to remove the student record from the database, ensuring the test is self-contained.
Essential Testing Strategies:
- Dynamic ID Chaining: I used Postman's scripting capabilities to capture the studentId from the POST response and automatically pass it to subsequent GET, PUT, and DELETE requests. This makes the test dynamic and reusable.
- Comprehensive Assertions: For each request, I have written multiple tests in the "Tests" tab to validate:
- HTTP Status Codes: Ensuring the API returns correct codes (e.g., 201 Created, 200 OK).
- Response Time: Checking that the API responds within an acceptable performance threshold (e.g., under 1000ms).
- Response Body Content: Verifying that the data returned in the response body is accurate and matches the data sent in the request (e.g., confirming the first_name is correct after creation and updates).
A Newman report has been generated for the API test
1. HTML Format: Report Link
refresh this web page again. |
|---|
