Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Test datasets

Learn how to use test datasets to store and reuse data across multiple test cases. This streamlines your testing process and enhancing test coverage.

Test datasets allow you to store reusable data that you can apply across multiple test cases. This streamlines your testing process by reducing manual data entry, minimizing errors, and quickly generating diverse scenarios to enhance test coverage.

This feature is available only to users on our Pro plan and above. Contact your admin to upgrade your plan.

Benefits of using test datasets

Using datasets provides you several key benefits:

  • Efficiency: Quickly reuse test data across multiple test cases.
  • Accuracy: Minimize manual errors by having consistent test data.
  • Comprehensive testing: Create multiple scenarios using different combinations of data.

Create test datasets from test case dashboard

Follow these steps to create test datasets directly from your test case dashboard:

  1. Navigate to the test cases dashboard from the left sidebar.
  2. Click the Datasets tab.

    Click data set tab on the test case dashboard

  3. Click Create Dataset.
  4. Select Create datasets manually.

    Select the create datasets manually tile

  5. In the Create Datasets window, enter the required data:
    • Enter a meaningful Dataset Title.
    • Define your dataset variables:
      • Enter distinct and descriptive variable names.
      • Click into each cell to enter the relevant values of each variable.
      • To add more variables, click Add Column, and to add values, click Add Row.

    Enter the required title, variable and values to create the dataset

  6. After entering your data, click Create to save your dataset.

Your dataset is now available and reusable across multiple test cases.

Remove rows and columns in a dataset

When working with datasets, you might need to remove rows or columns:

To remove a row:

  1. Hover over the row you wish to remove.
  2. Click the (⋮) icon at the end of the row.

    Click the options menu on the right side of the row

  3. Select Delete Row.

To remove a column:

  1. Hover over the column header you wish to remove.
  2. Click the (…) icon at the top of the column.

    Click the options menu on the top of the column

  3. Select Delete Column.

Ensure you save changes after adding or removing rows and columns to preserve updates.

Import or create datasets from test case creation or edit flow

You can create or import datasets while creating or editing a test case:

  1. Navigate to Create Test Case or Edit Test Case.
  2. In the Datasets field, click Import value from a dataset to include existing datasets or click Create Dataset to create a new one. Enter the required title, variable and values to create the dataset
  3. If you choose to import values from datasets, select the appropriate dataset.

    Select the dataset to import into the test case

  4. Select one or more rows (or all rows) whose values you want to import into the test case.

    Select all, or, one or more rows whose values you want to import into the test case
    Before you can add the same dataset again, you must first remove all linked columns from the test case.

  5. Click Link test case.
  6. Click Update.

How datasets work in test runs

When you create a test run, you select test cases and configurations (such as browsers or operating systems). If your selected test cases have associated datasets, each variable combination in the dataset creates distinct test executions. Additionally, every configuration multiplies the number of test executions further.

Example dataset:

Suppose you have a dataset for user authentication with the following variables:

Username Password Expected result
validUser validPass123 Login Successful
invalidUser invalidPass Error: Invalid User
validUser wrongPass Error: Invalid Pass
emptyUser emptyPass Error: Fields Empty
  • This dataset has 4 unique data rows.

Scenario example:

  • Suppose you select 3 different test cases, each linked to the above dataset.
  • You also choose 3 different configurations (Chrome, Firefox, and Safari) for this test run.

How total test cases are calculated

Test Management calculates the total number of distinct test cases as follows:

Total test cases that will be included in a test run = (Number of Dataset Rows) × (Number of Test Cases Using the Dataset) × (Number of Configurations)

Applying this calculation in our example numbers:

(4 dataset rows × 3 test cases × 3 configurations) = 36 distinct test cases will be included in a test run

Total number of test cases that will be included in a test run

Example of final test run details page with test cases expanded by datasets and configurations

Test run details page displays all associated test cases and datasets

As explained in the above example, by using datasets and multiple configurations, you significantly multiply your test coverage with minimal additional effort.

Test datasets in test runs help you efficiently manage extensive test coverage with minimal manual effort. Create, manage, and reuse datasets to streamline your test execution and significantly improve your overall test management process.

Test dataset combinations

When you link more than one dataset to a test case, Test Management creates row-by-row combinations across the selected rows of each dataset. The resulting dataset list defines all unique data combinations for that test case. When you start a test run, configurations (for example, browsers or OS) multiply this count again.

The total number of combinations is the product of the number of values in each linked dataset. You see a total of how many distinct tests will be performed when the case is executed. This combinatorial method is known as a cartesian product.

The formula is:

Total Combinations=(Selected rows in Dataset A)×(Selected rows in Dataset B)× ...

Let us understand this with the following example.

  • Dataset 1: First, add a dataset for countries and their currencies. You select all 3 rows available. The test case is now linked to this dataset, resulting in 3 combinations with the parameters Country and Currency.

    Add your first dataset

  • Dataset 2: Next, add a second dataset, Hotel Booking. Select only the rows you want to test certain booking types, so select only 2 rows, Bed & Breakfast and Full Board.

    Add your second dataset The final dataset is a combination of 6 rows.

After linking the selected rows, the system calculates the new total combinations:

3 (from Country & Currency) × 2 (from Hotel Booking) = 6 Combinations

The final set of combinations uses the Country data from the first dataset and combines it with the unique data from the second dataset, resulting in the following 6 test scenarios.

You see a final list of parameters in the combined dataset

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle