# Data Driven Testing

Virtuoso allows you to provide structured tables of data and associate them with your tests. This indicates that each test should be executed multiple times, one for each existing test data row.

In order to use test data, you first associate journeys with test data tables, then you associate test steps with test data attributes. Steps not associated with any attribute will use their own value during execution. However, a row may contain no value for a given attribute, in which case the step associated with this attribute will be executed without a value for that row.

The remaining of this section presents the following topics:

# Creating a test data table

To manage the test data tables associated to a project, click on the test data icon on the left side of the Dashboard. This will open the test data management screen.

No test data tables

Here you can add a new test data table to a project by choosing the project and clicking on the plus icon .

Create test data table

In this modal, you should provide the following information:

  • Name: A unique name that allows you to identify the test data table;

  • Description (optional): A small description that help you identify the test data table;

  • Data table (optional): A CSV (comma-separated values) file, containing attribute names and, optionally, rows of values, that Virtuoso uses to populate the new table. A row of values may contain less values than the number of attributes, but never the opposite. Note that the file must be UTF-8 encoded if you have any special characters.

# Viewing and editing a test data table

In the left side of the test data screen, you can see the list of data tables for each project. A green circle in the left of each table indicates if it is already in use.

View test data table

From the test data screen, you can also edit a test data table by clicking on the menu icon in the right corner associated with it and choosing the Edit / Import option. A modal very similar to the creation modal is presented. You can also update the table name and title by clicking on the edit icon , editing them, and hitting enter.

While importing, the CSV file may have no headers, i.e. you do not need to provide attribute names at the first line. Virtuoso will match the order of the attributes in the table with the order of the values provided in the file. If the file has more attributes than the table, the new attributes will be created, respecting the order in which they appear on the file.

The values contained in the file will completely replace the current values of the table. If you only want to add more values to the table, you may export current values to a file (see below), add the new values to the exported file, and import it back. If you import the same file twice nothing will change.

You can edit values in a data table directly. With the data table selection, hover the mouse pointer over a data row and a bin icon should appear on the right side to allow you to delete a row. Hovering the row also allows you to reorder it by dragging and dropping the row's anchor icon on the left. Discard and Save buttons will be enabled if there are unsaved modifications in the data table.

Clicking on a field of an empty row will create the row and assign a number to it. This line will be saved even if nothing is written to any of the columns. This allows you to have empty values in your test data set.

Multiples rows can be deleted or exported at once by selecting them using the check box located in the number column, clicking on the tab menu icon , and choosing Delete selected rows or Export selected rows.

In the Manage data table tab, you can add, edit, remove or reorder test data attributes. Additions and modifications are saved by hitting enter or changing focus to elsewhere. A confirmation dialog is show before deletion, but reordering has no confirmation.

# Managing a test data table

To add a new attribute, click on the plus icon in the top right corner of the table. The new attribute will be placed in the last position of the list.

Manage test data table

Test data attributes contain:

  • Name: A unique name that allows you to identify the test data attribute;

  • Description (optional): A small description that help you identify the test data attribute;

Once happy with the data entered, simply press enter in one of the two fields.

When the mouse pointer is over an attribute, a bin icon is shown on the right side to allow you to delete the attribute. A confirmation dialog is show before deletion. Multiples attributes can be deleted at once by selecting them using the check box located at the number column, clicking on the tab menu icon , and choosing Delete selected attributes.

Hovering over an attribute also allows you to reorder it. For that, drag and drop the attribute by the attributes anchor icon shown on the left side.

# Using test data in a journey

To start using test data in your tests, you should select the Manage test data option in the journey context menu, as shown in the next screenshot:

Manage journey test data table 1

The Test Data modal for the journey will be shown:

Test data modal 1

First, select the test data table to use, and then click Save.

Test data modal 2

Now, to use the the data in your journey, you have two options:

  1. Use variable names based on the attribute names: e.g., if you have an attribute (column) named name, then you can use this in your steps by for example write $name in "field". Any non-alphanumeric character is automatically converted to _ (underscore). For example, a column "first name" becomes $first_name.
  2. Specifically assign data to steps: you can select test steps in the right side of the modal and use the arrow icon located in right side of each attribute to indicate that the selected steps should use values from this attribute.

Test data modal 3

Having a test data table already assigned to a journey, you can also assign test data attributes to test steps using the step properties panel. For that, use the Test data attribute combo box.

Assign test data attribute to test step

The value provided to a test step will be ignored if a test data attribute is assigned.

# Executing a goal using test data

Once test steps have attributes assigned to them, you can execute the goal using test data from the Execute advanced option on the goal's menu or for a specific journey from the exploration page.

# Visualizing results on the execution report

The execution report of a journey that is associated with a test data table shows the execution results for each data row of your table that was executed. You can navigate among results by clicking on the execution sequence number shown in the upper left corner.

Execution-report-with-test-data

Last Updated: 10/13/2020, 11:52:29 AM