There are two ways to associate a test with a DataTable. The first way simply to create a new test and follow the steps below, training as you would any other test. Additionally, you can associate an existing test with a DataTable using the last section on this page titled: "How to associate an existing test with an existing DataTable."
It is important to note that tests are associated with zero or more DataTables, and not for specific plans. By default, tests will run with all associated DataTables and you can change this behavior by modifying individual plans.
- Create a new test from either the main dashboard page via the "New" button, or from the "Tests" page in the sidebar.
- Toggle "Show advanced options" on and scroll to the "DataTables" section.
- Choose one or more DataTables from the list of existing DataTables. (By default, the test will run each scenario from each table.)
We recommend making sure the "train with DataTable" button is selected so you can instantly use one of the above DataTables to train.
- Select the specific DataTable you'd like to train with using the "DataTable for training..." dropdown.
- If you'd like to add any advanced options, such as adding a login flow, do so now.
- Click the "Create test" button to start training.
- While training, you can view or manage the data-driven variables from the variables menu at the bottom of the Trainer.
- Save the test. Your test will now run in every plan it's in with the associated DataTables.
Important information about associating DataTables
When you associate a DataTable with a test, all instances of that test will automatically run using that DataTable for all future runs.
If you wish to run a test within a specific plan without a certain DataTable, you can choose to ignore DataTables in the plan stage settings.
- Navigate to the test you wish to associate with a DataTable, click on the "Update Info" button.
- In the modal, select a DataTable for the test in the "DataTables" dropdown.
Update info button
- Click the save button in the bottom of the modal, and you're all done!
Updating a test's information and settings
Associating Multiple DataTables
If you associate multiple DataTables with a single test, while training, you will only see the variables and default values from the first scenario of the first DataTable associated.
You can reference the variables from other related DataTables by going to Variables>Manage and adding them there. For example, consider a scenario with DataTables 1 and 2. DataTable 1 has variables A and B, and DataTable 2 has variables C and D. By default, you will only see variables A and B during training. To add variables C and D, go to Variables>Manage and define the default values there.
- To prevent a test from using a DataTable for a specific plan, edit the plan's settings.
- Find the specific test in the Tests section.
- Click the pencil icon to open up the options panel.
Editing a test's DataTable settings
- Click "Add parameter". To prevent the test from using any associated DataTable, set the Type field to "Ignore DataTables".
Setting a test to not use any associated DataTables
- If the test is associated with multiple DataTables, you can also force the test to run with a specific DataTable. To do so, set the "Type" field to "DataTable" and set the "DataTable" field to the specific DataTable you wish to use for this plan run.
Setting one specific DataTable to use for the test
Notice the number of test runs
A plan will run a test once for each row in the associated data tables, or once for each test without a data table (as before), multiplied by the number of browsers configured.
Ex: Suppose there is a plan configured to run on Chrome and Firefox with 3 tests, one with no data table, one with a data table with seven rows, and one with a data table with eleven rows. It will execute 2 (1 + 7 + 11) = 2 19 = 38 test runs each time the plan runs.
Data tables and default values
The default values assigned to the data-driven variables have a hierarchy. If the data-driven variable in a given test has a default value assigned to it that is different than the first scenario of the data table associated with it, it will automatically update to that scenario's value upon editing the test.
Updated about a year ago