0
0
Postmantesting~20 mins

Alert configuration in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Alert Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Alert Conditions in Postman Monitors

Which of the following alert conditions in Postman Monitors will trigger an alert only when the response time exceeds 2000 milliseconds?

AresponseTime < 2000
BresponseTime >= 2000
CresponseTime > 2000
DresponseTime == 2000
Attempts:
2 left
💡 Hint

Think about the condition that strictly checks if response time is more than 2000 ms.

Predict Output
intermediate
2:00remaining
Output of Alert Script with Status Code Check

What will be the output of the following Postman test script if the response status code is 404?

Postman
if (pm.response.code !== 200) {
    pm.alerts.trigger('Status code is not OK');
} else {
    pm.alerts.clear();
}

pm.test('Check alert triggered', () => {
    pm.expect(pm.alerts.hasAlerts()).to.be.true;
});
ATest fails because alert is not triggered
BTest passes because alert is triggered
CSyntaxError due to pm.alerts.trigger usage
DRuntime error: pm.alerts is undefined
Attempts:
2 left
💡 Hint

Check what happens when status code is not 200.

assertion
advanced
2:00remaining
Correct Assertion for Alert Message Content

Which assertion correctly verifies that the alert message contains the word 'timeout' in Postman test scripts?

Postman
const alertMessages = pm.alerts.getAll().map(alert => alert.message);
Apm.expect(alertMessages.contains('timeout')).to.be.true;
Bpm.expect(alertMessages.includes('timeout')).to.be.true;
Cpm.expect(alertMessages.find('timeout')).to.exist;
Dpm.expect(alertMessages.some(msg => msg.includes('timeout'))).to.be.true;
Attempts:
2 left
💡 Hint

Remember that alertMessages is an array of strings.

🔧 Debug
advanced
2:00remaining
Debugging Alert Not Triggering in Postman

A Postman monitor alert is not triggering even though the response time exceeds the threshold. Which is the most likely cause?

AThe alert condition uses <code>responseTime &lt; 2000</code> instead of <code>&gt;</code>
BThe response time is measured in seconds, but condition expects milliseconds
CThe alert script uses <code>pm.alerts.trigger()</code> incorrectly with no message
DThe monitor is disabled in Postman settings
Attempts:
2 left
💡 Hint

Check the alert condition logic carefully.

framework
expert
3:00remaining
Best Practice for Configuring Multiple Alerts in Postman Monitors

When configuring multiple alerts for different failure conditions in a Postman monitor, which approach ensures clear and maintainable alert management?

AUse separate <code>pm.alerts.trigger()</code> calls with distinct messages for each condition inside one test script
BCombine all conditions into one <code>if</code> statement and trigger a single alert with a generic message
CUse <code>pm.alerts.clear()</code> at the start and trigger alerts only for the first failing condition
DTrigger alerts only after the monitor run completes using external webhook integration
Attempts:
2 left
💡 Hint

Think about clarity and traceability of alerts.