> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.litmuscheck.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data‑Driven Tests

> Iterate test steps over datasets with parameters

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:

***

## 1. Upload Your Data File

First, you must upload your dataset, which should be in CSV format.

1. Navigate to the **Data** section from the main navigation.
2. Click on the **"Upload CSV"** button.
3. Select and upload the file containing your test data (e.g., `user_logins.csv`).
   <img src="https://mintcdn.com/litmuscheck/CakgjT-98Pfb8VJd/images/composing/Upload.png?fit=max&auto=format&n=CakgjT-98Pfb8VJd&q=85&s=6d953a49162cd45cc59ed8bdd9e75f25" alt="Test script" width="1912" height="872" data-path="images/composing/Upload.png" />

***

## 2. Link Data to Your Test

Next, you need to tell your test which data file to use.

1. Open the test you want to make data-driven.
2. In Compose Mode, click the **Settings** button (the gear icon) located next to the "Save" button.
3. A new screen will appear. Find the **"Use test data"** toggle and turn it on.
4. From the dropdown, select the CSV file you just uploaded.
5. Click **"Save"** to link the file to this test.
   <img src="https://mintcdn.com/litmuscheck/CakgjT-98Pfb8VJd/images/composing/UseData.png?fit=max&auto=format&n=CakgjT-98Pfb8VJd&q=85&s=e2f3f22b208188c605953d55b30dd7b6" alt="Test script" width="1915" height="824" data-path="images/composing/UseData.png" />

***

## 3. Use the Data in Your Test Steps

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.

### How it Works:

* **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.
  <img src="https://mintcdn.com/litmuscheck/CakgjT-98Pfb8VJd/images/composing/Logs_screenshot.png?fit=max&auto=format&n=CakgjT-98Pfb8VJd&q=85&s=62638a72ddbc31892cdf130fa77fd7a0" alt="Test script" width="1918" height="898" data-path="images/composing/Logs_screenshot.png" />
  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.
