# Data-driven API testing with CSV and Excel exports

Source: https://checkcraft.ru/en/guides/api-testing-from-csv.html · updated 2026-11-24

Prepare CSV variables and expected responses for Checkcraft Pro, run multiple rows and retry failures. Excel data uses a CSV export.

Practical workflow

Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. [Download, no sign-up →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

A request needs repeating with several inputs. Manual copies make it harder to track which input failed.

Checkcraft · 10 October 2026

Get help with your first test →

Checkcraft Pro

This workflow needs an active Pro license and a build containing Pro scenarios. See the [edition details](https://checkcraft.ru/en/pricing.html).

## Prepare the source request

Create a Pro scenario using a saved check and request. The example assumes {{customer}} is used in the relevant request field and the test service returns HTTP 200 with status CREATED. Adjust these illustrative expectations for your own contract.

```
id,name,var.customer,expect.status,expect./status
normal,Normal order,alice,200,CREATED
second,Second customer,bob,200,CREATED
```

## Preview the dataset

Paste CSV in the scenarios and data tab and preview the parsed rows. Keep a unique, stable id when editing a row. var.customer defines a variable, expect.status the HTTP status and expect./status the JSON field value. These are distinct expectations.

Repeating checks like this by hand? Checkcraft saves them and reruns them in one click. [Download Free →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

## Use an Excel worksheet

Create the same columns in Excel and export CSV. This does not claim native binary XLSX import. Verify UTF-8, comma delimiters and quoting around values containing commas. Spreadsheet regional settings may produce another delimiter.

## Run and retry failures

Save the scenario, choose an environment and run the dataset. After fixing the cause, retry failed rows from the last run of that scenario. Check prior side effects before repeating writes. Functional dataset execution is not load generation.

## What data-driven testing is

One request runs over a table of values: each row is a separate case with its own input and expectation. One test covers equivalence classes and boundary values without copy-paste.

```
qty,promo,expectedStatus,expectedTotal
1,,201,1000
2,SALE10,201,1800
0,,400,
-1,,400,
1000,,422,
```

Expectation columns matter as much as inputs. Without them the test only sends requests and checks nothing.

## CSV traps from Excel

| Problem | What it looks like | Fix |
|---|---|---|
| Delimiter | Some locales save with semicolons | Save as CSV UTF-8 with commas or set the delimiter in the tool |
| Encoding | Non-Latin text turns into garbage | Save in UTF-8 |
| BOM at the start | The first column is named \ufeffqty | Save without BOM or handle it when reading |
| Decimal comma | 10,5 reads as two columns | Use a dot or quote the value |
| Leading zeros | Code 007 became number 7 | Set the cell format to text before typing |
| Dates | Excel changes the date format | Write ISO 8601 dates as text |

## Running in Newman and pytest

### Newman

```
newman run orders.postman_collection.json -e test.postman_environment.json -d data.csv
```

CSV columns become variables: {{qty}} in the request body, pm.iterationData.get("expectedStatus") in the test.

```
pm.test("status per table", () => {
  pm.response.to.have.status(Number(pm.iterationData.get("expectedStatus")));
});
```

### pytest

```
import csv, pytest

with open("data.csv", encoding="utf-8-sig") as f:
    CASES = list(csv.DictReader(f))

@pytest.mark.parametrize("case", CASES, ids=lambda c: f"qty={c['qty']}")
def test_order(case, api):
    r = api.post("/orders", json={"sku": "A-1", "qty": int(case["qty"]), "promo": case["promo"] or None})
    assert r.status_code == int(case["expectedStatus"])
```

The utf-8-sig encoding strips a BOM if the file was saved from Excel.

## How to build the case table

- One representative per class: normal value, zero, negative, too large.
- Boundaries: minimum, minimum minus one, maximum, maximum plus one.
- Combinations that affect each other: promo and quantity, plan and region.
- A row with empty optional fields.
- One row, one meaning. If a row checks three things at once, a failure does not say which broke.

Value selection techniques are covered in [API automation for manual testers](https://checkcraft.ru/en/guides/api-testing-for-manual-qa.html).

Next step

## Start with Free, add Pro for this workflow

This workflow needs Pro. Requests, response rules and log correlation are free with no time limit, so you can try the app first and add Pro when you need it.

[Download Free](https://checkcraft.ru/en/download-checkcraft.html#free-download) · [Download and first run](https://checkcraft.ru/en/download-checkcraft.html)

No sign-up or email needed, the archive is ready in a couple of minutes. See the [edition limits](https://checkcraft.ru/en/pricing.html).

## Continue with a related task

[API regression testing and response comparison](https://checkcraft.ru/en/guides/api-regression-testing.html) · [API test reports in HTML, TXT and JUnit XML](https://checkcraft.ru/en/guides/api-test-reports.html) · [Verify database persistence after an API request](https://checkcraft.ru/en/guides/api-database-verification.html)

Start with the linked example and compare its result with your own test requirement.

Ask a person

## Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

[Ask in Telegram](https://t.me/checkcraftchat)Send an email

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

Page card: /ai/pages/en/guides/api-testing-from-csv.md
