Bird
Raised Fist0
Postmantesting~20 mins

Reporter options (CLI, HTML, JUnit) in Postman - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Reporter Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the output format of the default Postman CLI reporter?
When running Postman tests via CLI, what is the default format of the test report output?
Postman
newman run collection.json
AA simple text summary printed in the terminal
BA JSON file with all test results
CA JUnit XML file generated automatically
DA detailed HTML report saved to disk
Attempts:
2 left
💡 Hint
Think about what you see immediately after running tests in terminal
🧠 Conceptual
intermediate
2:00remaining
Which reporter option generates a detailed interactive report in Postman?
You want to generate a detailed, interactive report with charts and test details after running Postman tests. Which reporter option should you use?
AJSON reporter
BJUnit reporter
CCLI reporter
DHTML reporter
Attempts:
2 left
💡 Hint
Think about which format is best for viewing in a browser
❓ assertion
advanced
2:00remaining
Which assertion correctly checks if a JUnit report file was generated after running Newman with JUnit reporter?
You run Newman with the JUnit reporter option. Which assertion correctly verifies the JUnit XML report file exists?
Postman
const fs = require('fs');
const reportPath = './newman/results.xml';
// Assertion here
Aassert(fs.existsSync(reportPath), 'JUnit report file should exist');
Bassert(fs.readFileSync(reportPath), 'JUnit report file should exist');
Cassert(fs.exists(reportPath), 'JUnit report file should exist');
Dassert(fs.fileExists(reportPath), 'JUnit report file should exist');
Attempts:
2 left
💡 Hint
Check Node.js fs module methods for checking file existence
🔧 Debug
advanced
2:00remaining
Why does the HTML reporter not generate a report file when running Newman with this command?
You run: newman run collection.json --reporters cli,html But no HTML report file is created. What is the likely cause?
AThe CLI reporter disables HTML report generation
BThe HTML reporter is not supported in Newman
CYou forgot to specify the output file path with --reporter-html-export
DYou need to install a separate package for HTML reports
Attempts:
2 left
💡 Hint
Check how to specify output file for HTML reporter
❓ framework
expert
3:00remaining
How to configure multiple reporters in Newman programmatically to generate CLI, HTML, and JUnit reports?
You want to run Newman tests from a Node.js script and generate CLI output, an HTML report saved as 'report.html', and a JUnit report saved as 'results.xml'. Which code snippet correctly configures this?
Postman
const newman = require('newman');

newman.run({
  collection: require('./collection.json'),
  reporters: [...],
  reporter: {
    html: { export: '...' },
    junit: { export: '...' }
  }
}, function (err) {
  if (err) { throw err; }
  console.log('Run complete!');
});
Areporters: ['cli', 'html', 'junit'], reporter: { html: 'report.html', junit: 'results.xml' }
Breporters: ['cli', 'html', 'junit'], reporter: { html: { export: 'report.html' }, junit: { export: 'results.xml' } }
Creporters: ['cli', 'html', 'junit'], reporter: { html: { path: 'report.html' }, junit: { path: 'results.xml' } }
Dreporters: ['cli', 'html', 'junit'], reporter: { html: { file: 'report.html' }, junit: { file: 'results.xml' } }
Attempts:
2 left
💡 Hint
Check Newman reporter options object structure in documentation

Practice

(1/5)
1. Which reporter option in Postman is best for quickly viewing test results directly in the terminal?
easy
A. JSON reporter
B. HTML reporter
C. CLI reporter
D. JUnit reporter

Solution

  1. Step 1: Understand reporter types

    CLI reporter shows results in the terminal quickly, HTML creates detailed reports, and JUnit is for integration.
  2. Step 2: Match reporter to quick terminal output

    CLI reporter is designed for quick terminal output, so it fits the requirement.
  3. Final Answer:

    CLI reporter -> Option C
  4. Quick Check:

    Quick terminal output = CLI reporter [OK]
Hint: CLI means command line, perfect for terminal output [OK]
Common Mistakes:
  • Confusing HTML reporter as quick terminal output
  • Choosing JUnit reporter for terminal display
  • Thinking JSON reporter is default quick output
2. Which of the following is the correct syntax to run a Postman collection with an HTML reporter using the CLI?
easy
A. newman run collection.json --reporter html
B. newman run collection.json --reporter-html
C. newman run collection.json -r html
D. newman run collection.json --reporters=html

Solution

  1. Step 1: Recall Postman CLI reporter syntax

    The correct syntax uses '--reporter' followed by the reporter name without extra symbols.
  2. Step 2: Check each option

    newman run collection.json --reporter html uses '--reporter html' which is correct. newman run collection.json --reporter-html and D have incorrect flags, and C uses shorthand '-r' which is invalid.
  3. Final Answer:

    newman run collection.json --reporter html -> Option A
  4. Quick Check:

    Correct flag is '--reporter html' [OK]
Hint: Use '--reporter html' exactly for HTML reports in CLI [OK]
Common Mistakes:
  • Using '--reporter-html' instead of '--reporter html'
  • Using shorthand '-r' which is not supported
  • Adding '=' sign in '--reporters=html'
3. What will be the output when running this command?
newman run test_collection.json --reporter junit
Choose the best description.
medium
A. Displays test results in the terminal in JUnit style
B. Generates a JUnit XML report file for integration with CI tools
C. Creates an HTML report and opens it in the browser
D. Runs tests silently without any output

Solution

  1. Step 1: Understand JUnit reporter purpose

    JUnit reporter generates XML files compatible with CI/CD tools for test result integration.
  2. Step 2: Match command output

    The command uses '--reporter junit' which creates the XML report file, not terminal display or HTML report.
  3. Final Answer:

    Generates a JUnit XML report file for integration with CI tools -> Option B
  4. Quick Check:

    JUnit reporter = XML report file [OK]
Hint: JUnit reporter creates XML files for CI tools, not terminal output [OK]
Common Mistakes:
  • Thinking JUnit reporter shows output in terminal
  • Confusing JUnit with HTML reporter
  • Assuming no output is generated
4. You run this command but get an error: newman run collection.json --reporter html junit. What is the likely cause?
medium
A. Missing comma between reporter names
B. Collection file name is invalid
C. HTML reporter is not supported in Newman
D. Incorrect flag usage for multiple reporters

Solution

  1. Step 1: Check syntax for multiple reporters

    Newman requires multiple reporters to be specified with the '--reporters' flag and comma-separated list.
  2. Step 2: Analyze given command

    The command uses '--reporter' once and lists reporters without commas, which is invalid syntax.
  3. Final Answer:

    Incorrect flag usage for multiple reporters -> Option D
  4. Quick Check:

    Use '--reporters html,junit' for multiple reporters [OK]
Hint: Use '--reporters html,junit' for multiple reporters [OK]
Common Mistakes:
  • Using '--reporter' instead of '--reporters' for multiple
  • Not separating reporter names with commas
  • Assuming HTML reporter is unsupported
5. You want to run a Postman collection and generate both a detailed HTML report and a JUnit XML report for CI integration. Which command correctly achieves this?
hard
A. newman run collection.json --reporters html,junit
B. newman run collection.json --reporter html --reporter junit
C. newman run collection.json --reporters html;junit
D. newman run collection.json --reporters html junit

Solution

  1. Step 1: Understand multiple reporter syntax

    Newman uses '--reporters' flag with comma-separated reporter names to run multiple reporters.
  2. Step 2: Evaluate each option

    newman run collection.json --reporters html,junit uses correct syntax with '--reporters html,junit'. newman run collection.json --reporter html --reporter junit uses '--reporter' twice which is invalid. Options A and D use incorrect separators.
  3. Final Answer:

    newman run collection.json --reporters html,junit -> Option A
  4. Quick Check:

    Multiple reporters = '--reporters html,junit' [OK]
Hint: Use '--reporters' with comma-separated names for multiple reports [OK]
Common Mistakes:
  • Using multiple '--reporter' flags instead of one '--reporters'
  • Separating reporters with semicolon or space instead of comma
  • Assuming only one reporter can be used
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard