0
0
Postmantesting~10 mins

Monitor scheduling in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test checks if a Postman monitor is scheduled correctly and runs at the expected time. It verifies that the monitor triggers and completes successfully.

Test Code - Postman Test Script
Postman
pm.test("Monitor runs successfully at scheduled time", function () {
    pm.expect(pm.response.code).to.equal(200);
    pm.expect(pm.response.json().status).to.equal("completed");
    pm.expect(pm.response.json().run_at).to.be.a('string');
});
Execution Trace - 6 Steps
StepActionSystem StateAssertionResult
1Test startsPostman environment ready with monitor scheduled-PASS
2Monitor triggers at scheduled timeMonitor run initiated by Postman scheduler-PASS
3Postman sends request and receives responseResponse received with status code 200 and JSON bodypm.response.code == 200PASS
4Test script runs assertions on responseResponse JSON contains status and run_at fieldspm.response.json().status == 'completed'PASS
5Test script checks run_at field is a stringrun_at field present and is a string timestamppm.response.json().run_at is a stringPASS
6Test completes successfullyMonitor run verified as successful and on schedule-PASS
Failure Scenario
Failing Condition: Monitor does not run at scheduled time or response status is not 'completed'
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the monitor's response status?
AIt should be 'completed'
BIt should be 'pending'
CIt should be 'failed'
DIt should be empty
Key Result
Always verify both the response status code and the expected data fields to confirm that scheduled monitors run correctly and complete as expected.