0
0
Postmantesting~10 mins

Data file integration (CSV, JSON) in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test runs a Postman collection using a CSV data file to send multiple requests with different user data. It verifies that the API responds with status 200 for each user.

Test Code - Postman
Postman
pm.test('Status code is 200', function () {
    pm.response.to.have.status(200);
});
Execution Trace - 8 Steps
StepActionSystem StateAssertionResult
1Test collection run starts with CSV data file containing multiple user recordsPostman Runner opens and loads CSV file with user data rows-PASS
2Postman sends first request using first row data from CSV (e.g., userId=1, name='Alice')Request URL and body populated with first user data-PASS
3Postman receives response for first requestResponse status 200 and valid JSON body receivedCheck response status is 200PASS
4Postman runs test script to assert status code 200Test script executed in Postman sandboxpm.test('Status code is 200', function () { pm.response.to.have.status(200); });PASS
5Postman sends second request using second row data from CSV (e.g., userId=2, name='Bob')Request URL and body populated with second user data-PASS
6Postman receives response for second requestResponse status 200 and valid JSON body receivedCheck response status is 200PASS
7Postman runs test script to assert status code 200 for second requestTest script executed in Postman sandboxpm.test('Status code is 200', function () { pm.response.to.have.status(200); });PASS
8Postman completes all requests from CSV data fileAll rows processed, test results collectedAll requests returned status 200PASS
Failure Scenario
Failing Condition: API returns status other than 200 for any user data row
Execution Trace Quiz - 3 Questions
Test your understanding
What does Postman use the CSV data file for in this test?
ATo run the same request multiple times with different data
BTo store test scripts
CTo save response bodies
DTo configure Postman settings
Key Result
Using data files in Postman allows running the same test with many inputs easily, improving test coverage and saving time.