Skip to main content

Data-Driven Testing

Run the same API scenario with different input data. Proofarc supports data sets that feed variables into your test steps.

Creating a Data Set

POST /api/datasets
{
"name": "User Registration Data",
"projectId": 1,
"description": "Test data for user creation scenarios",
"entries": [
{"username": "john_doe", "email": "john@example.com", "role": "USER"},
{"username": "jane_admin", "email": "jane@example.com", "role": "ADMIN"},
{"username": "test_viewer", "email": "viewer@example.com", "role": "VIEWER"},
{"username": "", "email": "invalid", "role": "UNKNOWN"}
]
}

Linking Data Set to Scenario

Configure the scenario to use a data set:

"dataSourceConfig": {
"dataSetId": 1,
"failFast": true,
"parallelism": 1
}
FieldDescription
dataSetIdID of the data set to use
failFastStop on first failure (true) or run all (false)
parallelismNumber of entries to execute in parallel (1 = sequential)

Using Data Set Variables

Reference data set fields in your steps with {{fieldName}}:

{
"stepOrder": 1,
"name": "Create user from data set",
"httpMethod": "POST",
"endpointPath": "/api/users",
"requestBody": "{\"username\":\"{{username}}\",\"email\":\"{{email}}\",\"role\":\"{{role}}\"}",
"expectedStatusCodes": [201]
}

Execution Flow

When you execute a data-driven scenario:

  1. The scenario runs once per data set entry
  2. Each run substitutes the entry's values into {{variables}}
  3. Results tracked per entry — see which data inputs pass or fail
  4. The overall scenario status reflects all entries

Results

Each data set entry produces its own execution result:

Entry 1: john_doe / john@example.com / USER → PASSED (7/7 steps)
Entry 2: jane_admin / jane@example.com / ADMIN → PASSED (7/7 steps)
Entry 3: test_viewer / viewer@example.com / VIEWER → PASSED (7/7 steps)
Entry 4: (empty) / invalid / UNKNOWN → FAILED (step 1: validation error)

Use Cases

  • Boundary testing — empty strings, long strings, special characters
  • Role-based testing — same flow with different user roles
  • Multi-tenant testing — same API, different tenant credentials
  • Negative testing — invalid inputs that should fail validation