In order to run the same test with different sets of data, you need to create a DataTable. There are several ways to create a DataTable in mabl:
DataTables can have a maximum of 1000 scenarios (rows) and 500 variables (columns).
In the mabl app
To create a new DataTable in the mabl app, take the following steps:
- Click on Configurations in the left-hand navigation.
- Navigate to the DataTables tab.
- Click on the + New DataTable button.
The DataTables page
- In the DataTable editor, click on the pencil icon next to Untitled DataTable to give it a name. Optionally, you can add it to a resource group to manage access to this DataTable at a more granular level.
- Enter your data in the editor:
- To add variables, click on Add variable. Enter the variable name in the row header, then add the values for each scenario (row) below.
- To add a scenario, click on Add scenario. Enter the scenario name in the "Scenario name" column. Add the values for each variable in this scenario.
- If your data resides in a spreadsheet, you can copy and paste up to 100 rows of spreadsheet values into the table.
- Save the DataTable.
Keyboard shortcuts
Use keyboard shortcuts to manage your DataTable without repetitive mouse clicks
- Jump to edges - use Ctrl/⌘ + ↑ or ↓ to instantly go to the top or bottom of the DataTable
- Next cell - use Tab to move through data fields
- Filter - use Ctrl/⌘ + F to place your cursor directly in the filter bar
- Edit - press Enter to start editing a selected cell
- Expand cell - use Shift + Space to expand a text input area when working with long variable values
- Add scenario - use Alt/Option + S to add a new scenario
- Add variable - use Alt/Option + V to add a new variable
From a CSV file
Currently, CSV is the only supported file format for DataTables. There are two ways to upload a CSV file to the mabl app:
- Upload directly to the DataTables page - go to Configuration > DataTables and click on the Upload CSV button. This option is good for starting with new DataTables.
- Upload within the DataTable editor - go to Configuration > DataTables, create or edit a DataTable, and click on the Upload CSV icon in the editor. This option is helpful if you want to immediately edit the CSV upon upload, or if you want to replace an existing DataTable with new Data.
Uploading a CSV within the DataTable editor
The first row of the CSV is converted into DataTable variable names when imported into mabl. For example, if the following table were uploaded as a DataTable, the variables would be login_button, welcome_message, logout_button.
| login_button | welcome_message | logout_button |
|---|---|---|
| Login | Welcome back | Logout |
| Iniciar sesión | Qué bueno verte de nuevo | Cerrar sesión |
| ログイン | お帰りなさい | ログアウト |
If you did not add a Scenario name column to your CSV file, the Scenario name column appears empty. You can add scenario names in the DataTable editor.
From test data-driven variables
If a test contains test data-driven variables, you can create a DataTable table from the test details page by clicking the Generate DataTable button.
Clicking on this button takes you to the add new DataTable page, where you can add different scenarios to test.
In the mabl CLI
Use the mabl datatables create command to create a new DataTable in the mabl CLI.
Using the mabl API
Use the create DataTable endpoint to create a DataTable using the mabl API.
