What is TDM Mapping?
When Test Data is needed in order to execute tests across various scenarios, you can use the TDM feature in order to map a Data Source to a particular Test Case. This article will show you how to map data from multiple sources to a single test case There are two methods to map data to a test case:
There are two types of mappings:
A Read mapping reads data from the Data Source for taking data from that source and putting it into the test case. An example might be entering a Username and Password that was previously stored in a .csv file or a database.
A Write mapping supports temporarily stored data within a Test Case or Orchestration at the time of execution. The data stored in a Write can be used within the same orchestration or test while that test is running. An example might be having the first test case within an orchestration create an account and store the random credentials that might be used to create that account. If later in that workflow, whether in the same test, or another test within the Orchestration, you can Read from those same columns in order to reuse the random data that was generated with the Write mapping.
NOTE: TDM Data Mapping supports character data to include foreign accent words.
To Map the Data to a Test Case:
Go to any project
Next to a test case, select the Action drop down, then select Details.
Select the TDM tab in the navigation menu of the test case.
Auto Mapping supports downloading a template for the test case so that, all at once, all mapping may be configured in bulk. Only Actions Input, Verify, PageInit, and Clicks are supported with Auto Mapping. Other Action types must be manually mapped.
Two controls for this page will be located on the left side, directly under the test case navigation.
To download a template for TDM use, select the download button. Two options will populate on the dropdown selection:
- Download Template
- Download Template for selected actions
NOTE: This option is used for customizable selections, meaning there are specific steps to be parameterized - not every single step of the test.
Once an option is selected, a .csv file named TestDataSource containing all (or selected test information) will download. If data management will only be used on specific actions, select selected actions so only relevant data is included in the download. Open the download.
Add data as needed in the provided columns.
NOTE: If a column has a blank value, the attribute mapped will be set to "blank". Some examples would be adding multiple URLs, emails, or names (or whatever the data may be for a particular test case). Mapping a column is optional and can be skipped entirely.
In the case below, two additional rows are added with a unique email, first name, and last name for each test.
When all data is entered in the file, select Save.
How to Add a New Data Source in a Test Case
Data Sources may be added to the project separately, or they may be added at the time of mapping. During mapping, the following instructions will show how to create a Data Source.
To add a New Data Source, select the Data Source button from the menu.
A New Data Source popup will open. Select the plus icon.
In the new window, fill out:
- File Type
- Dataset Upload - upon selecting this, the local file directory will open. Select the TestDataSource template that was previously downloaded and updated prior to this step.
- Select Submit - this will start the Auto Mapping workflow.
Manual Mapping is supposed on all Action types and may be mapped for any Attribute for an Action.
- Select the icon next to an Action in order to start the workflow.
Select Map Data Source from the Modal window that shows up.
Select the Data Source, or create a New Data Source as needed.
Select the Column that you'd like to map to the test step.
NOTE: If the user maps a column and that value happens to be blank, the attribute mapped to will be set to "blank".
Select Mapping Type for a Read or Write mapping.
For Read mapping, select Delete Data Source row. After executing this test in a TDM Orchestration run, the data source row being used will be deleted.
NOTE: All data sets using that data source row will also be removed. This is great for scenarios where you have one-time-use data.
For Write mapping, select Update Data Source row. After executing this test in a TDM Orchestration, the data source row being used, in addition to the data set, will be updated to match whatever data was written to this column. You also have the option to select Add a new Data Source row. If this is selected a new data source row will be added based on the resulting data set record.
- Select the Attribute that you would like to map. The current value of that attribute will be shown under Default Value. If a random value was selected in the test case, you may see something similar to [functionizeappType].
- Click Submit to save the mapping.