0
0
Postmantesting~20 mins

Data file with Newman in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Data File Mastery with Newman
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of Newman run with CSV data file
You run Newman with the command:
newman run collection.json -d data.csv
The CSV file contains 3 rows of data. What will be the total number of iterations executed by Newman?
A3
B1
C0
DDepends on the number of requests in the collection
Attempts:
2 left
💡 Hint
Each row in the data file corresponds to one iteration.
assertion
intermediate
2: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;
});
Apm.expect(pm.environment.get('username')).to.not.be.empty;
Bpm.expect(pm.variables.get('username')).to.not.be.empty;
Cpm.expect(data.username).to.not.be.empty;
Dpm.expect(pm.iterationData.get('username')).to.not.be.empty;
Attempts:
2 left
💡 Hint
Use pm.iterationData to access data file variables.
🔧 Debug
advanced
2: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?
AThe JSON data file is an object instead of an array of objects
BNewman does not support JSON data files
CThe collection has only one request, so only one iteration runs
DThe data file path is incorrect, so Newman ignores it
Attempts:
2 left
💡 Hint
Newman expects JSON data files to be arrays of objects.
🧠 Conceptual
advanced
2: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?
AData file variables and environment variables are merged and cannot override each other
BEnvironment variables override data file variables during iterations
CData file variables override environment variables during iterations
DNewman ignores environment variables when a data file is used
Attempts:
2 left
💡 Hint
Data file variables have higher priority in iteration context.
framework
expert
2: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?
Anewman run collection.json -d data.csv -r html
Bnewman run collection.json -d data.csv --reporter html --reporter-html-export report.html
Cnewman run collection.json -d data.csv --reporter-html-export report.html
Dnewman run collection.json --data data.csv --reporters html,json
Attempts:
2 left
💡 Hint
Use --reporter and --reporter-html-export flags for HTML reports.