Challenge - 5 Problems
Newman CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Newman CLI command?
You run the following command to execute a Postman collection using Newman CLI:
What will be the result of this command?
newman run mycollection.json --reporters cli,json
What will be the result of this command?
Postman
newman run mycollection.json --reporters cli,json
Attempts:
2 left
💡 Hint
Newman supports multiple reporters separated by commas.
✗ Incorrect
Newman allows specifying multiple reporters separated by commas. Here, both CLI and JSON reports will be generated and shown.
❓ assertion
intermediate2:00remaining
Which assertion correctly checks the HTTP status code in a Postman test script?
Inside a Postman collection test script, you want to assert that the response status code is 200. Which code snippet correctly does this?
Postman
pm.test('Status code is 200', function () { pm.response.to.have.status(200); });
Attempts:
2 left
💡 Hint
Use pm.response.to.have.status with a function inside pm.test.
✗ Incorrect
Option A uses the correct syntax with a function and the assertion pm.response.to.have.status(200). Option A uses arrow function with implicit return, which is valid. Option A and D are incorrect syntax.
🔧 Debug
advanced2:00remaining
Why does this Newman CLI command fail to run the collection?
You run this command:
But it fails with an error. What is the cause?
newman run collection.json --env environment.json --folder
But it fails with an error. What is the cause?
Postman
newman run collection.json --env environment.json --folder
Attempts:
2 left
💡 Hint
Check if all options have required arguments.
✗ Incorrect
The --folder option requires the name of the folder inside the collection to run. Omitting the folder name causes an error.
🧠 Conceptual
advanced2:00remaining
What is the purpose of the --delay-request option in Newman CLI?
When running a Postman collection via Newman CLI, what does the --delay-request option do?
Attempts:
2 left
💡 Hint
Think about pacing requests to avoid server overload.
✗ Incorrect
The --delay-request option adds a pause between each request in the collection, useful to avoid hitting rate limits or server overload.
❓ framework
expert3:00remaining
How to integrate Newman CLI with a CI/CD pipeline for automated testing?
You want to run Postman collections automatically in your CI/CD pipeline using Newman CLI. Which approach is best practice?
Attempts:
2 left
💡 Hint
Automation means no manual steps and failing builds on test failures.
✗ Incorrect
The best practice is to add Newman commands in the pipeline scripts to run tests automatically and fail builds if tests fail, ensuring quality gates.