Skip to content

Data-Driven Testing

Data-driven testing lets Orbittest Client run the same request many times — once per row of your data. You prepare a small data file (a spreadsheet saved as CSV, or a JSON list), reference its columns as {{variables}} in your request, and Orbittest Client swaps in each row as it runs.

The two formats behave identically — pick whichever is easier for you.

📊 Use a spreadsheet (CSV)

The easiest path. Build a table in Excel or Google Sheets and save it as CSV. Jump to the CSV guide ↓

The simplest way to make a data file is in Excel (or Google Sheets), then save it as a CSV file.

  1. Set up your sheet. Put your column names in the first row — these names become your variables. Each row below is one test run. For example, to test fetching different users:

    userIdexpectedName
    1Leanne Graham
    2Ervin Howell
    3Clementine Bauch
  2. Save it as CSV. In Excel: File → Save As → “CSV (Comma delimited) (*.csv)”, and save it as e.g. users.csv. (In Google Sheets: File → Download → Comma-separated values (.csv).) Your file now looks like this inside:

    users.csv
    userId,expectedName
    1,Leanne Graham
    2,Ervin Howell
    3,Clementine Bauch
  3. Use the columns in your request. Reference any column with {{columnName}} — in the URL, headers, or body. For example, in the URL:

    https://api.example.com/users/{{userId}}
  4. Run it. Right-click your collection → RunAttach data file → pick users.csvRun. Orbittest Client runs the request once per row, swapping {{userId}} each time (/users/1, /users/2, /users/3).

In Post-Run scripts you can also read the current row with ot.data.columnName and check the results:

ot.test("name matches", () => {
ot.expect(ot.response.json.name).toBe(ot.data.expectedName);
});

Spreadsheet:

nameemail
Jane Doejane@example.com
John Smithjohn@example.com

Request body:

{ "name": "{{name}}", "email": "{{email}}" }

Each row sends one new record.

Prefer JSON? Orbittest Client accepts that too. A JSON data file is simply an array (a list) of objects, where each object is one test run and its keys are your variable names.

[
{ "column1": "value", "column2": "value" },
{ "column1": "value", "column2": "value" }
]
  • The square brackets [ ] wrap the whole list.
  • Each { } block is one iteration (one run of your request).
  • The keys (userId, expectedName…) become your {{variables}}.
  1. Write your data. Using the same “fetch users” example:

    users.json
    [
    { "userId": 1, "expectedName": "Leanne Graham" },
    { "userId": 2, "expectedName": "Ervin Howell" },
    { "userId": 3, "expectedName": "Clementine Bauch" }
    ]
  2. Save it with a .json extension, e.g. users.json. Make sure:

    • Text values are wrapped in double quotes ("Leanne Graham").
    • Numbers don’t need quotes (1), but quoting them is fine too.
    • Every object is separated by a comma, and there’s no comma after the last one.
  3. Use the keys in your request — exactly like CSV, reference any key with {{keyName}}:

    https://api.example.com/users/{{userId}}
  4. Run it. Right-click your collection → RunAttach data file → pick users.jsonRun. It runs once per object in the list.

Data file:

new-users.json
[
{ "name": "Jane Doe", "email": "jane@example.com" },
{ "name": "John Smith", "email": "john@example.com" }
]

Request body:

{ "name": "{{name}}", "email": "{{email}}" }
CSVJSON
Easiest to make✅ Excel / Sheets → Save as CSVBest when data is already JSON, or has nested values
Looks likea spreadsheeta list of objects
Good whensimple rows of text / numbersyou’re comfortable with JSON or exporting from code

Both behave identically in Orbittest Client — pick whichever is easier for you. 🎉