You have a Postman collection with 3 requests: Login, Get Profile, and Logout. You want to run them in sequence so that Login runs first, then Get Profile, then Logout. How does Postman Collection Runner execute these requests by default?
Think about how a playlist works when you play songs one by one.
Postman Collection Runner executes requests sequentially in the order they appear in the collection. This ensures workflows like login before profile fetch work correctly.
Consider this Postman test script attached to a request:
console.log('Start test');
pm.test('Status code is 200', () => {
pm.response.to.have.status(200);
});
console.log('End test');What will be the order of console logs when this test runs?
Think about synchronous vs asynchronous code execution.
console.log statements run immediately in order. The assertion inside pm.test runs after these logs but does not affect their order.
You want to check if the environment variable authToken is set after a login request. Which locator syntax correctly accesses this variable in a Postman test script?
Check Postman API for environment variable access methods.
The correct method to get an environment variable is pm.environment.get('variableName'). Other options are invalid or deprecated.
You receive this JSON response from an API:
{"user": {"id": 123, "name": "Alice"}}Which Postman test assertion correctly checks that the response has a user key?
Use Chai assertion style with pm.expect and to.have.property.
Option B correctly uses Chai's to.have.property to check for the key in the parsed JSON object.
You have a Postman collection with requests: Step1, Step2, and Step3. You want to run Step1 and then conditionally run Step3 skipping Step2. Which test script code in Step1 achieves this?
Remember the exact method name and object to call for controlling request flow.
The correct method is postman.setNextRequest(). Option C uses it conditionally to skip Step2.