Create DataTables
A DataTable is a file that contains data for tests. It can have multiple columns and rows that contain data. Each data row in a DataTable signifies one test run.
A DataTable can be used as a command parameter in a command that is part of a loop. For this, you must first configure a test variable that has a value of type DataTable.
DataTables let you run the same test flow using different data. For example, if you create two DataTables for a login flow, one for Admin users and one for users with fewer permissions, you can run different tests using the relevant DataTables. You can add one or more DataTables to a test flow.
You could have multiple rows for distinct users, each with a different set of permissions. They don't need to be split into different DataTables.
A DataTable includes the following rows:
-
Title row: The first row specifies the column name and can be any name you wish.
-
Data Type row: The second row specifies the data type for the column.
Allowed data types are: Boolean, Device, Number, Media, String
-
Data row: The third row and the subsequent rows represent the test data. Data must conform to the type in Row 2.
In your tests, you can use a DataTable as:
-
A test command parameter (when the command is part of a loop). For more information, see To use a DataTable in a command. Using a DataTable as a command parameter requires that you first configure a test variable of type DataTable.
-
An iteration in a loop. For more information, see configure a loop to use a DataTable.
Watch this video for an overview of working with DataTables.
Scriptless Mobile allows you to create a new DataTable and save it to a location of your choice.
-
On the top toolbar, click the DataTable button and select Create new DataTable.
-
In the Create new DataTable view, enter the column name.
-
Select the desired data type for the column.
-
Click Add row.
-
Select or enter data according to the selected data type. You can add as many data rows as required and select or enter data for those rows.
-
To add a new row, move your cursor to the last row and last cell of your DataTable, and press the tab key. This functionality works only if the cell has a data type of String or Number.
-
To reorder a row, drag the handle icon at the beginning of the row.
-
-
Click Add column to add a column to your DataTable. You can add a name to the column, select the data type and add data accordingly. Repeat this step to add more columns and data to the table as necessary.
-
For a column with Device data type, you can select multiple devices and add them to your DataTable in one go. The devices appear as one device per data row.
-
To reorder a column, drag the handle icon at the top-right of the column.
-
To delete a column, click the delete icon beside the column name. To delete a row, select the checkbox next to the row and click the DELETE button.
-
-
Click SAVE AS.
-
In the Save as DataTable dialog box, enter the name of the DataTable.
-
Expand the folders and select a destination to save the DataTable. You can also create a new folder for the DataTable.
Tip: The available default folders are Public DataTables and My DataTables. You can create a new folder in any of these folders. You can see an org group folder only if you belong to the org group. For more information about users and an org group, see Manage users. If you hover over an empty folder that is not one of the default folders, a delete folder icon appears. If you hover over any DataTable, a delete file icon appears. -
Click SAVE.
-
With Scriptless Mobile, you can open and modify an existing DataTable and save it to the existing or new location.
-
On the top toolbar, click the DataTable button and select Open DataTable.
-
In the Open DataTable view, in the left pane, expand the folders and select the desired DataTable.
The available default folders are Public DataTables and My Datatables. An org group folder is visible here if you belong to an org group.
The selected DataTable appears in the right pane.
Important: A warning icon appears when a device or media in the selected DataTable becomes unavailable.Restriction: In Scriptless Mobile, a DataTable with a column of URL data type gets converted to String data type. If you make any changes to this column and save it, the DataTable column will appear as a String data type in Scriptless Mobile and other applications. -
Click EDIT or double-click the DataTable to open it in edit mode.
Caution: Making changes to a DataTable will overwrite the previously saved version. -
(Optional) In the view that opens, click Add column to add a column to your DataTable. You can add a name to the column, select the data type, and add data accordingly. Repeat this step to add more columns and data to the table if necessary.
To reorder a column, drag and drop the handle icon at the top-right of the column.
-
(Optional) Click Add row to add a row to your DataTable. You can add data to the corresponding columns. Repeat this step to add more rows and data to the table if necessary.
For a column with Device data type, you can select multiple devices and add them to your DataTable in one go. The devices appear as one device per data row.
-
To add a new row, move your cursor to the last row and last cell of your DataTable, and press tab on your keyboard. This functionality works only if the cell has a String or Number data type.
-
To reorder a row, drag the handle icon at the beginning of the row.
-
-
Click SAVE or SAVE AS.
-
For the SAVE option, click YES to overwrite the existing DataTable version. In the Save as DataTable dialog box, click SAVE.
-
For the SAVE AS option, do the following:
-
In the Save as DataTable dialog box, enter a name for the DataTable.
-
Expand the folders and select a destination folder. You can also create a new folder and save the DataTable in it.
Tip: The available default folders are Public DataTables and My DataTables. You can create a new folder in any of these folders. You can see an org group folder only if you belong to the org group. For more information about users and an org group, see Manage users. If you hover over an empty folder that is not one of the default folders, a delete folder icon appears. If you hover over any DataTable, a delete file icon appears. -
Click SAVE.
-
-
To import a DataTable, you can use a CSV file. You can upload a CSV file to the application from your local machine. You can also edit the imported DataTable and save it.
You can use the sample CSV file provided in the application. You can access it here: SampleDT.csv.
-
On the top toolbar, click the DataTable button and select Upload DataTable.
-
In the Upload DataTable view, to upload a file from your local machine, drag a CSV file or click upload a file.
-
In the dialog box that opens, navigate to your desired folder, select your file and click Open.
If the file and its content get approved, the data in the CSV file appears in the right pane.
A warning icon appears if:
-
A device or media becomes unavailable.
-
A column name is missing.
-
A column data type provided is invalid.
-
-
(Optional) In the right pane, click EDIT to make changes to the uploaded file, as follows:
-
Click Add column to add a column to your DataTable. You can add a name to the column, select the data type and add data accordingly. Repeat this step to add more columns and data to the table if necessary.
-
Click Add row to add a row to your DataTable. You can add data to the corresponding columns. Repeat this step to add more rows and data to the table if necessary.
-
Make changes to the data type or data for existing columns or rows.
-
Click SAVE AS.
-
In the Save as DataTable dialog box, do the following:
-
Enter a name for the DataTable.
-
Expand the folders and select a destination folder. You can also create a new folder and save the DataTable in it.
Tip: The available default folders are Public DataTables and My DataTables. You can create a new folder in any of these folders. You can see an org group folder only if you belong to the org group. For more information about users and an org group, see Manage users. If you hover over an empty folder that is not one of the default folders, a delete folder icon appears. If you hover over any DataTable, a delete file icon appears. -
Click SAVE.
-
-
The command parameter of a test can use a DataTable. In this case, an existing DataTable acts as a command parameter value.
The following requirements apply before adding a DataTable to a command parameter:
-
A DataTable must be created and saved in the repository. An existing DataTable can also be used.
-
The test variables must be configured to have a variable of type DataTable.
Adding a DataTable to a command involves creating a loop, selecting the DataTable, and specifying the relevant DataTable column for the command parameter.
-
In the open test, expand the loop and select a command.
-
Double-click the command.
-
In the command dialog box, for any parameter, select the Usage value as DataTable.
-
In the Value list, select DataTable name and Column from the available list.
Restriction: Here, Scriptless Mobile provides a list of columns with a data type that matches the parameter data type. The column data type must always match the parameter data type. -
Click APPLY.