An output block in Postman shows the results of your test scripts after running a request. It helps you see if your tests passed or failed.
Output block in Postman
// Example of test script output in Postman pm.test('Status code is 200', function () { pm.response.to.have.status(200); }); console.log('Test completed');
The output block shows results from pm.test() assertions and console.log() messages.
You can view the output block in the Postman app under the Test Results tab after running a request.
pm.test('Response time is less than 500ms', function () { pm.expect(pm.response.responseTime).to.be.below(500); });
pm.test('Response has JSON body', function () {
pm.response.to.be.json();
});console.log('Response status:', pm.response.code);This script runs two tests: one checks if the status code is 200, the other checks if the response JSON has a userId property. It also logs a message to the output block.
// Test script in Postman pm.test('Status code is 200', function () { pm.response.to.have.status(200); }); pm.test('Response body has userId', function () { const jsonData = pm.response.json(); pm.expect(jsonData).to.have.property('userId'); }); console.log('Tests finished');
Use pm.test() to create tests that show pass or fail in the output block.
Use console.log() to print helpful messages or variable values for debugging.
The output block updates only after you send the request and run the tests.
The output block shows test results and logs after running a request.
It helps you quickly see if your API tests passed or failed.
Use it to debug and verify your test scripts in Postman.