Challenge - 5 Problems
Data File Mastery with Newman
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Newman run with CSV data file
You run Newman with the command:
The CSV file contains 3 rows of data. What will be the total number of iterations executed by Newman?
newman run collection.json -d data.csvThe CSV file contains 3 rows of data. What will be the total number of iterations executed by Newman?
Attempts:
2 left
💡 Hint
Each row in the data file corresponds to one iteration.
✗ Incorrect
Newman runs one iteration per row in the data file. Since the CSV has 3 rows, Newman runs 3 iterations regardless of the number of requests.
❓ assertion
intermediate2:00remaining
Assertion on data-driven test variable in Postman
In a Postman test script, you want to assert that the variable 'username' from the data file is not empty during each iteration. Which assertion is correct?
Postman
pm.test('Username is not empty', () => { pm.expect(pm.iterationData.get('username')).to.not.be.empty; });
Attempts:
2 left
💡 Hint
Use pm.iterationData to access data file variables.
✗ Incorrect
pm.iterationData.get('username') accesses the current iteration's data file variable. Other options access environment or global variables, not data file.
🔧 Debug
advanced2:00remaining
Debugging Newman run with JSON data file
You run Newman with a JSON data file containing 2 objects. The test results show only 1 iteration executed. What is the most likely cause?
Attempts:
2 left
💡 Hint
Newman expects JSON data files to be arrays of objects.
✗ Incorrect
If the JSON data file is a single object, Newman treats it as one iteration. It must be an array of objects for multiple iterations.
🧠 Conceptual
advanced2:00remaining
Understanding environment variable behavior with data files in Newman
When running Newman with a data file, which statement about environment variables and data file variables is true?
Attempts:
2 left
💡 Hint
Data file variables have higher priority in iteration context.
✗ Incorrect
During each iteration, data file variables override environment variables with the same name.
❓ framework
expert2:00remaining
Configuring Newman to generate a detailed HTML report with data file run
You want to run Newman with a CSV data file and generate a detailed HTML report. Which command correctly achieves this?
Attempts:
2 left
💡 Hint
Use --reporter and --reporter-html-export flags for HTML reports.
✗ Incorrect
Option B correctly specifies the data file, enables the html reporter, and exports the report to report.html.