Data-driven testing allows you to run the same test multiple times with different sets of data. For example, instead of creating three separate tests for three different user logins, you can create one test that runs three times, pulling each username and password from a data file.Here is how to set it up:
Now you can reference the data from your file in any test step.To use a value, you reference the column header from your CSV file using the following format: ${COLUMN_HEADER}
Example:
If your CSV has a column header named Task_data, you would enter '${Task_data}' into an “Input” step’s value field.
In Compose Mode: The test will only use the data from the first row (Row 1) of your CSV file for validation and composing.
In a Saved Run: When you save and run the test, it will execute one full time for every single row in your CSV file. You can see the results for each data row in the “Logs” section.
As seen in the image above, the test ran 10 times (once for each data row). The data index in the logs shows which row was used for that specific execution, allowing you to see which data sets passed or failed.