0
0
Postmantesting~10 mins

DELETE request in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test sends a DELETE request to remove a user by ID and verifies that the response status code is 200, confirming successful deletion.

Test Code - Postman
Postman
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Response body confirms deletion", function () {
    const jsonData = pm.response.json();
    pm.expect(jsonData.message).to.eql("User deleted successfully");
});
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test startsPostman app is open with DELETE request prepared-PASS
2Sends DELETE request to https://api.example.com/users/123Request sent to server to delete user with ID 123-PASS
3Receives response with status code 200 and JSON bodyResponse body: {"message": "User deleted successfully"}Check if status code is 200PASS
4Checks response body message equals 'User deleted successfully'Response JSON parsedVerify response message confirms deletionPASS
5Test ends with all assertions passedTest report shows success-PASS
Failure Scenario
Failing Condition: Server returns status code other than 200 or message is different
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify after sending the DELETE request?
AThe response status code is 200
BThe response contains a list of users
CThe request method is GET
DThe server returns an error
Key Result
Always verify both the HTTP status code and the response body content to confirm that a DELETE request succeeded as expected.