0% found this document useful (0 votes)
0 views5 pages

API Testing With Postman

This practical activity focuses on API testing using Postman, covering CRUD requests, response validation, and negative testing. Students will learn to create REST requests, validate responses, and interpret results while testing a simulated online content service. The document outlines tasks for importing collections, inspecting resources, creating and updating data, deleting resources, and conducting negative tests, along with reflection questions on the testing process.

Uploaded by

blackrobotiot
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)
0 views5 pages

API Testing With Postman

This practical activity focuses on API testing using Postman, covering CRUD requests, response validation, and negative testing. Students will learn to create REST requests, validate responses, and interpret results while testing a simulated online content service. The document outlines tasks for importing collections, inspecting resources, creating and updating data, deleting resources, and conducting negative tests, along with reflection questions on the testing process.

Uploaded by

blackrobotiot
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

SOFTWARE TESTING & QA | PRACTICAL LAB 5

PRACTICAL ACTIVITY SHEET

API Testing with Postman


CRUD requests, response validation, negative testing, and collection execution

60 min
Duration

Learning outcome
By the end of this practical, students should be able to create and organize REST requests in Postman,
use collection variables, validate responses with JavaScript assertions, design positive and negative API
tests, and interpret Collection Runner results.

Scenario
You are testing a simple online content service. The service exposes posts that can be retrieved, filtered,
created, replaced, partially updated, and deleted. Your task is to verify functional behavior and identify
validation limitations using the supplied Postman collection.

IMPORTANT JSONPlaceholder is a fake REST API. POST, PUT, PATCH, and DELETE responses are simulated;
changes are not permanently saved. Assess the response contract, not database persistence.

Resources
API base URL: [Link]
Sample collection: Postman_Practical_JSONPlaceholder.postman_collection.json
Recommended evidence: Screenshots of request, response, Tests tab, and Collection Runner summary

API Testing with Postman | Page 1 of 5


SOFTWARE TESTING & QA | PRACTICAL LAB 5

Student details

Name / Student ID Date

TASK 1 | Import and configure the collection 5 marks

ACTION Open Postman and select Import. Import the supplied JSON collection. Open the collection
Variables tab and confirm baseUrl, postId, and userId.
Evidence: Record the three variable values and capture one screenshot of the Variables tab.

Variable Value Purpose

TASK 2 | Retrieve and inspect resources 10 marks

ACTION Run requests 01, 02, and 03. Inspect status, response time, Content-Type, body structure, and
test results.
Evidence: Complete the table using actual observations from Postman.

Request Status Body type Tests passed Key observation

01 - All posts

02 - Post by ID

03 - Filter by userId

Question 2.1: Why is checking only the 200 status code insufficient for validating a GET response?

Student answer

API Testing with Postman | Page 2 of 5


SOFTWARE TESTING & QA | PRACTICAL LAB 5

TASK 3 | Create, replace, and partially update data 12 marks

ACTION Run request 04. Change the title, body, and userId values, then resend. Confirm the 201
response and returned ID.
Evidence: Record input values, returned ID, and which assertions passed.

Operation Request data changed Expected Actual Pass/Fail

ACTION Run requests 05 and 06. Compare the PUT request body with the PATCH request body.

Evidence: Explain the practical difference between full replacement and partial update.

Method Fields sent Status Response evidence

Question 3.1: Which method should be used when only the title must change, and why?

Student answer

TASK 4 | Delete a resource 5 marks

ACTION Run request 07. Record the status code and response body. Send the request twice and
compare the results.
Evidence: State whether the observed behavior is consistent with an idempotent operation.

Attempt Status Response body Interpretation

API Testing with Postman | Page 3 of 5


SOFTWARE TESTING & QA | PRACTICAL LAB 5

TASK 5 | Negative and exploratory testing 10 marks

ACTION Run request 08 for a non-existent post. Verify the status and examine the body.

Evidence: Record the expected and actual result.

ACTION Run request 09 with an empty JSON body. Observe whether the API rejects the request.

Evidence: Do not mark an unexpected 201 as correct production behavior. Record it as a validation limitation of
the sample API.

Test condition Expected result Actual result Risk / defect observation

Invalid resource ID

Blank POST payload

Wrong data type for


userId

Your own negative test

Design one additional negative test from the following techniques: blank mandatory field, boundary
value, invalid format, duplicate data, unauthorized request, expired token, or wrong HTTP method. If the
sample API cannot enforce the rule, explain the expected production behavior.

TASK 6 | Add or modify Postman assertions 5 marks

ACTION Open the Tests tab of any request and add one new assertion that is not already supplied.

Evidence: Paste the script and record the test result.

Assertion purpose Postman test script Result

Suggested assertion ideas: validate Content-Type, maximum response time, a required field, an exact ID,
array length, JSON data type, or a business rule.

API Testing with Postman | Page 4 of 5


SOFTWARE TESTING & QA | PRACTICAL LAB 5

TASK 7 | Run the complete collection 3 marks

ACTION Use Run collection and execute all nine requests once. Review the summary.

Evidence: Capture the final runner summary and record totals below.

Requests run Tests executed Passed Failed Failure reason / action

Final evidence log (No need)

Evidence item Included? File name / screenshot number

Collection variables

Successful GET response and tests

POST/PUT/PATCH response

Negative test evidence

Collection Runner summary

Reflection
1. Which assertion provided the strongest evidence that the API response was correct?

Response

2. What is one limitation of using JSONPlaceholder for validation testing?

Response

API Testing with Postman | Page 5 of 5

You might also like