Data-driven Testing

Trigger batches of test runs with variable values from a CSV file

Search our documentation:

Toggle Documentation Menu

Data-driven Testing

Data-driven testing allows you to supply a set of inputs and verifiable outputs to be used within a test to quickly and easily ensure that your application performs as expected with a range of data. Ghost Inspector has a built-in option for data-driven testing that allows you to upload a CSV spreadsheet file with rows of values corresponding to variables in your test(s).

Step-by-Step Instructions

To get started, you'll want to swap one or more variables into your test step values.

Sample steps using variables

For each row in the uploaded spreadsheet, a test or suite run will be triggered using those variable values. This feature is available as "Run with Spreadsheet Data..." under the "More" dropdown menu in both suites and tests.

Run Test with Spreadsheet Data...

The modal dialog presented includes formatting instructions for the CSV spreadsheet and allows you to upload the file. The first row should contain the variable names. Each row after the first represents a set of data to be used in your test(s) with values corresponding to the variable for that column. Paid plans support 1,000 data rows.

Instructions for formatting spreadsheet data

After uploading your file, you'll be shown a summary of the data that will be used in your test runs.

Review spreadsheet data that will be used in tests

Once submitted, the test or suite runs will be triggered with the data provided.

If you wish to execute tests or suites using a CSV file through our API, that can be done by including the file in a POST request using the dataFile parameter.
Note: This feature has the capacity to trigger a large number of test runs, so please ensure you're aware of the usage required. For instance, uploading a spreadsheet with 100 rows of data for a single test will trigger 100 test runs. Uploading the same spreadsheet for a suite containing 10 tests will result in 1,000 test runs being triggered (100 rows x 10 tests).