Associating and running tests with a DataTable

DataTables are associated on the test level, and they can be associated with both new and existing tests.

When DataTables are enabled (or configured at the plan level), the test generates one run for each scenario, or row, of the DataTable(s) that it is associated with

How to associate a new test with an existing DataTable

  1. Create a new test from either the main dashboard page via the "New" button, or from the "Tests" page in the sidebar.
  2. Toggle "Show advanced options."
  3. Scroll to the "DataTables" section.
  4. Choose one or more DataTables from the list of existing DataTables.

👍

Train with DataTable

We recommend making sure the "train with DataTable" button is selected so you can instantly use one of the above DataTables to train.

  1. Select the specific DataTable you'd like to train with using the "DataTable for training..." dropdown. (Add any other settings as needed.)
881881

Associating a new test with a DataTable

  1. Click the "Create test" button to start training.
  2. While training, you can view or manage the data-driven variables from the variables menu at the bottom of the mabl Trainer. Tests train with the first scenario from a DataTable.
  3. Save the test.

How to associating existing tests and DataTables

  1. Navigate to the test you wish to associate with a DataTable
  2. Click on the Edit icon.
  3. In the modal, select a DataTable for the test in the "DataTables" dropdown.
622622

Associating an existing test with a DataTable

  1. Click the save button in the bottom of the modal, and you're all done!

📘

Associating multiple DataTables

You can associate multiple DataTables with a single test. When you are training, however, you will only see the variables and default values from the first scenario of the first DatatTable associated.

For example, if you associate a test with DataTable 1 and DataTable 2, you will only see variables and values from the first scenario of DataTable 1 during training. If you need to reference variables from DataTable 2, you can add them as default values in the mabl Trainer by creating test data-driven variables.

Running DataTable scenarios in a plan

If a plan includes a test that uses a DataTable, by default, the plan will run all associated DataTables. You can change this behavior by modifying individual plans. And if such a test is in a plan stage that runs sequentially, the tests will run one at a time in order through the DataTable scenarios.

🚧

Notice the number of test runs

A plan will run a test once for each row in the associated data tables multiplied by the number of browsers configured. For example, if a plan is configured to run on Chrome and Firefox with 3 tests, one with no data table, one with a data table with seven scenarios, and one with a data table with eleven scenarios. It will execute 38 test runs each time the plan runs.

Preventing an associated DataTable from running in a plan

To prevent a test from using a DataTable for a specific plan, take the following steps:

  1. Click on the Edit icon to open the Edit plan page.
  2. Find the specific test in the Tests section.
  3. Click the pencil icon to open up the options panel.
873873

Edit the test settings in the Edit plan page.

  1. Click "Add parameter".
  2. Set the Type field to "Ignore DataTables." This parameter prevents the test from using any associated DataTables.
428428
  1. Click "Done" to confirm your settings.
  2. Click "Save."

Setting one specific DataTable for a test

If a test that runs in a plan is associated with multiple DataTables, you can force the test to run with a specific DataTable by taking the following steps:

  1. Click on the Edit icon to open the Edit plan page.
  2. Find the specific test in the Tests section.
  3. Click the pencil icon to open up the options panel.
  4. Click "Add parameter".
  5. Set the "Type" field to "DataTable."
  6. Set the "DataTable" field to the specific DataTable you wish to use for this plan run.
430430
  1. Click "Done" to confirm your settings.
  2. Click "Save."

Running DataTable scenarios in an ad hoc test run

For an ad hoc test run, you can run DataTable scenarios by taking the following steps:

  1. Navigate to the test you wish to run.
  2. Click "Run test."
  3. Select the "Cloud run" tab. Configure any settings as needed.
  4. Toggle on "Run datatable scenarios."
418418
  1. Click "Start run." The "Start run" button will update to reflect the number of scenarios that will run.

🚧

LIMITATION

In a local run, the test will use the variable values for the first scenario. Running all DataTable scenarios in local runs is not supported.


Did this page help you?