0
0
Postmantesting~20 mins

Running collections via CLI in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Newman CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Newman CLI command?
You run the following command to execute a Postman collection using Newman CLI:
newman run mycollection.json --reporters cli,json

What will be the result of this command?
Postman
newman run mycollection.json --reporters cli,json
AThe command runs but outputs only a JSON report file without CLI output.
BThe command runs but only outputs the CLI report, ignoring JSON.
CThe command fails because multiple reporters cannot be specified together.
DThe collection runs and outputs results in both CLI and JSON report formats.
Attempts:
2 left
💡 Hint
Newman supports multiple reporters separated by commas.
assertion
intermediate
2: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);
});
Apm.test('Status code is 200', function () { pm.response.to.have.status(200); });
Bpm.test('Status code is 200', function () { pm.response.status === 200; });
Cpm.test('Status code is 200', () => pm.response.to.have.status(200));
Dpm.test('Status code is 200', function () { pm.response.statusCode(200); });
Attempts:
2 left
💡 Hint
Use pm.response.to.have.status with a function inside pm.test.
🔧 Debug
advanced
2:00remaining
Why does this Newman CLI command fail to run the collection?
You run this command:
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
AThe --folder option requires a folder name argument which is missing.
BThe collection file must be named collection.postman_collection.json.
CThe --env option must be specified after --folder.
DNewman does not support running collections with environment files.
Attempts:
2 left
💡 Hint
Check if all options have required arguments.
🧠 Conceptual
advanced
2: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?
AIt delays the start of the entire collection run by the specified milliseconds.
BIt retries failed requests after the specified delay.
CIt adds a delay in milliseconds between each request execution.
DIt delays the generation of the report until all requests finish.
Attempts:
2 left
💡 Hint
Think about pacing requests to avoid server overload.
framework
expert
3: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?
ARun Newman manually on the build server after deployment to production.
BAdd a script in the pipeline configuration that runs 'newman run' with collection and environment files, and fail the build if tests fail.
CUse Newman only locally and upload reports manually to the CI server.
DReplace Newman with a GUI tool for CI/CD integration.
Attempts:
2 left
💡 Hint
Automation means no manual steps and failing builds on test failures.