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.
To execute your test(s) utilizing multiple data sets, see TDM - Orchestrations.
To create a Data Source via Database connection or Template, see TDM - Data Source Creation.
What is Mapping?
In order to perform Data Driven Testing, you'll need to connect or map your Data Source to your Test Case.
There are two methods for mapping data to a test case:
- Auto Mapping
- Manual Mapping
And 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.
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.
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.
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.
NOTE: TDM Data Mapping supports character data to include foreign accent words.
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.
- Click the TDM button to open the available Data Source list.
- Click the Data Source.
- The Auto Mapping workflow will open to the Action matching the first column of data. Confirm the match and the Mapping Type, then click Attach.
NOTE: You may click Attach All to map the data set without viewing each Action.
- Continue Attaching Columns to Actions. Click Done.
- Review the Mapping. View by Mapped Columns, Missed Columns, and Unified View. Click OK.
- Mapped Columns
- Missed Columns
- Unified View
- Mapped Columns
- Each Action mapped to the Data Source will display a label in the Action footer. Click the label to Edit the mapping and click the X to Delete.
- In addition, all Data Sources mapped in a Test Case will display on the Test Details page.
Manual Mapping in Test Detail Page
Manual Mapping is available for most Action types and may be mapped to any Attribute for an Action.
- Select the Action and expand to see Action Details.
Click Add Test Data.
Select the Data Source, or add a Data Source as needed.
Select the Column that you'd like to map to the Action.
NOTE: If the user maps a column and that value happens to be blank, the attribute mapped will be set to "blank".
Select Read or Write Mapping Type.
- 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 OK to save the mapping.
- The mapping is now visible in the Action footer. Click the label to Edit the mapping or remove by clicking the X.
Manual Mapping in Slider View
You can also add, edit, and delete mappings while in Slider View the same as on the Test Detail page.
- Click the Gear icon on the Action to open Action Settings.
- Click Add Test Data.
- Select the Column, Mapping Type, and Data Source Row instructions as above. Click Next.
- Set the Attribute for the Action and click OK.
Add a Data Source within a Test Case
Open a test in your Project.
Click the TDM button.
- Click Add a Data Source.
- In the Create Data Source modal, give the new source a meaningful name and select the file type.
- Upload your file. Click Submit.
- Your new Data Source will be in the list for selection.