đ Data-Driven Testing
Run the same request, folder, collection, or exported collection multiple times using data from a CSV or JSON file.
Each row in the data file becomes one complete execution of the selected request(s), making it easy to validate APIs against multiple datasets without manually changing variables between runs.
đģ Syntaxâ
fc-cli dd [options]
âī¸ Optionsâ
| Option | Description |
|---|---|
--req | Run one or more requests by name or ID |
--fol | Run a folder by name or ID |
--col | Run a collection by name or ID |
--file | Run an exported collection |
--data | CSV or JSON data file (required) |
--dd-format | Data file format (csv or json) |
--dd-separator | CSV separator (,, ;, or tab) |
--stop-on-fail | Stop execution after the first failed row |
--validate | Validate variables without executing requests |
--var | Override the Variable Set by name or ID |
--var-file | Override variables for an exported collection |
--export | Export the test report |
--export-path | Directory where reports are saved |
đ¯ Supported scopesâ
Data-driven testing can be executed against:
- A single request
- Multiple requests
- A folder
- A collection
- An exported collection (
--file)
đ Basic Usageâ
| Action | Command |
|---|---|
| Run a collection | fc-cli dd --col "User APIs" --data users.csv |
| Run a collection by ID | fc-cli dd --col <collection-id> --data users.csv |
| Run a folder | fc-cli dd --fol "Authentication" --data users.csv |
| Run a folder by ID | fc-cli dd --fol <folder-id> --data users.csv |
| Run a request | fc-cli dd --req "Login" --data users.csv |
| Run a request by ID | fc-cli dd --req <request-id> --data users.csv |
| Run multiple requests | fc-cli dd --req "Login,Get Profile,Update User" --data users.csv |
| Run an exported collection | fc-cli dd --file collection.json --data users.csv |
| Run a folder from an exported collection | fc-cli dd --file collection.json --fol "Authentication" --data users.csv |
| Run a request from an exported collection | fc-cli dd --file collection.json --req "Login" --data users.csv |
| Override Variable Set | fc-cli dd --col "User APIs" --var "Production" --data users.csv |
| Override variables for an exported collection | fc-cli dd --file collection.json --var-file variables.json --data users.csv |

đĻ Run an Exported Collectionâ
Fetch Client CLI can execute an exported collection JSON file directly.
This mode does not require the Fetch Client database or the VS Code extension.
Running an exported collection is completely self-contained.
- â No Fetch Client database required
- â No VS Code extension required
- â Perfect for CI/CD pipelines
- â Easy to share with teammates
- â Great for running APIs on build agents or remote machines
đī¸ Data file formatsâ
CSVâ
The first row must contain column headers.
username,password,expectedStatus
alice,secret123,200
bob,password123,401
JSONâ
The data file can contain an array of objects.
[
{
"username": "alice",
"password": "secret123",
"expectedStatus": 200
},
{
"username": "bob",
"password": "password123",
"expectedStatus": 401
}
]
đ Using data variablesâ
Each column name becomes a variable that can be referenced inside requests.
For example:
{{username}}
{{password}}
{{expectedStatus}}
During execution, the values are replaced using the current row from the data file.
âī¸ Data file optionsâ
Specify the file formatâ
Normally the CLI detects the format from the file extension.
To specify it explicitly:
fc-cli dd \
--col Users \
--data users.txt \
--dd-format csv
Supported values:
csvjson
Specify a CSV separatorâ
The default separator is a comma.
fc-cli dd \
--col Users \
--data users.csv \
--dd-separator ";"
Supported separators:
,;tab
â Validating variablesâ
Before executing requests, you can validate that every variable used by the selected requests exists in the data file.
fc-cli dd \
--col Users \
--data users.csv \
--validate
The CLI reports:
- Variables found
- Missing variables
- Available columns
No requests are executed when using --validate.
âšī¸ Stop on failureâ
By default, every row is executed even if earlier rows fail.
To stop immediately after the first failed row:
fc-cli dd \
--col Users \
--data users.csv \
--stop-on-fail
đ§ Variable setsâ
Database collectionsâ
Override the variable set used during execution.
fc-cli dd \
--col Users \
--var Production \
--data users.csv
If the collection is already linked to a variable set, the linked variable set takes precedence.
Exported collectionsâ
Use a variable file.
fc-cli dd \
--file collection.json \
--var-file variables.json \
--data users.csv
đĨ Variable precedenceâ
Variables are resolved using the following priority:
- Data file row
- Collection variable set
- Request defaults
If a variable exists in both the data file and the selected variable set, the value from the data file is used.
đ Execution flowâ
For each row in the data file:
- Load the row values.
- Merge variables.
- Execute the selected request(s) sequentially.
- Record request results.
- Continue with the next row.
For multiple selected requests, every request is executed before moving to the next data row.
đĨī¸ Console outputâ
During execution, the CLI displays:
- Current row
- Request name
- HTTP method
- Status code
- Response time
- Test assertion summary
- PASS/FAIL result
- Error message (if any)
After completion, a summary is displayed showing:
- Total rows
- Total requests
- Passed requests
- Failed requests
đ¤ Exporting reportsâ
Reports can be exported after the run completes.
JSONâ
fc-cli dd \
--col Users \
--data users.csv \
--export json
CSVâ
fc-cli dd \
--col Users \
--data users.csv \
--export csv
HTMLâ
fc-cli dd \
--col Users \
--data users.csv \
--export html
NUnitâ
fc-cli dd \
--col Users \
--data users.csv \
--export nunit
Export to a custom directoryâ
fc-cli dd \
--col Users \
--data users.csv \
--export html \
--export-path ./reports
Supported export formatsâ
| Format | Description |
|---|---|
| JSON | Complete execution report |
| CSV | Spreadsheet-friendly report |
| HTML | Interactive report |
| XML | Structured XML report |
| NUnit | NUnit-compatible XML report |
đ Gracefully stopping a testâ
Press Ctrl+C while the test is running.
-
First Ctrl+C
- Stops after the current request finishes.
- Prints the final summary.
- Generates export reports if requested.
-
Second Ctrl+C
- Immediately terminates the process.
đ§ Limitsâ
| Setting | Maximum |
|---|---|
| Data rows | 100 |
đĄ Examplesâ
Execute a collectionâ
fc-cli dd \
--col "User APIs" \
--data users.csv
Validate variables onlyâ
fc-cli dd \
--col "User APIs" \
--data users.csv \
--validate
Execute with stop-on-failureâ
fc-cli dd \
--col "User APIs" \
--data users.csv \
--stop-on-fail
Execute selected requestsâ
fc-cli dd \
--req "Login,Get Profile" \
--data users.csv
Execute an exported collectionâ
fc-cli dd \
--file collection.json \
--data users.csv \
--var-file variables.json
Export an HTML reportâ
fc-cli dd \
--col "User APIs" \
--data users.csv \
--export html \
--export-path ./reports
đ Notesâ
- CSV and JSON data files are supported.
- A maximum of 100 data rows can be processed in a single run.
- Requests execute sequentially for each data row.
- Variable validation can be performed before execution using
--validate. - Request assertions are evaluated normally during data-driven testing.
- Reports can be exported in JSON, CSV, HTML, XML, and NUnit formats.
- Press Ctrl+C once to stop gracefully while preserving completed results.