Skip to content

ehasan101/StudentManagement-API_Testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 

Repository files navigation

API_Testing-Project


API Testing: Student-Management with Postman

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.

Exploring My Testing Process: A Video Walkthrough!

How to run this project!

  1. Install Postman.
  2. Install Node.js.
  3. Download Project file.
  4. Now Import collection & environment file into Postman:
    file > import > choose the method > press 'import'
  5. Run Desired API request

Run on cmd

  1. Open cmd on project folder or move to project folder cd Downloads/project_file
  2. Run the follwing command Install newman npm install -g newman
  3. Now newman run Student_Management.postman_collection.json -e Std_Manage.postman_environment.json
  4. If want to export test results
    first install them
    npm install -g newman-reporter-html
    and npm install -g newman-reporter-htmlextra
  5. Now run follwing command for report
    newman run Student_Management.postman_collection.json -e Std_Manage.postman_environment.json -r cli,htmlextra

HTTP Status Codes

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 Errors

http_status_code


Working Scenarios & What I have done in this Testing!

This 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).

Test Report with Newman :

A Newman report has been generated for the API test

1. HTML Format: Report Link

2. Snapshots of Report:

  • Summary Report Summary_1 Summary-2
  • Total Requests Total_1 Total_2
  • Failed Requests Failed

⚠️ if you face any type of image broken/missing issue, please refresh this web page again.

#Happy_Testing


About

This repository contains a Postman collection for testing the Student Management API. The project is designed to automate the validation of the API's endpoints, ensuring that all CRUD (Create, Read, Update, Delete) operations for student data function correctly.

Topics

Resources

Stars

Watchers

Forks

Contributors