Mapping Test Data Overview
When test data is needed to drive test execution across various scenarios, you can use the Functionize TDM feature to map a Data Source to a particular Test Case. This guide provides an overview of mapping test data and how to perform data-driven testing in Functionize.
To execute your test(s) utilizing multiple data sets, see TDM - Orchestrations.
To create a Data Source via data file or database connection, see TDM - Data Source Creation.
What is Mapping?
Mapping connects a Data Source to a Test Case to perform data-driven testing. There are two methods for mapping data to a test case: Auto Mapping and Manual Mapping. Additionally, there are two types of mappings: Read and Write.
-
Read Mapping: Reads data from the Data Source and uses it in the test case. For example, entering a Username and Password stored in a .csv file or a database. If the "Delete Data Source Row" option is selected, the data source row will be deleted after test execution, making it suitable for one-time-use data.
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. -
Write Mapping: Temporarily stores data within a test case or orchestration at the time of execution. The stored data can be used within the same orchestration or test. For example, creating an account and storing the random credentials generated during the test execution back to the data source for later reuse in the same or another test within the orchestration. When using Write Mapping, you can select "Update Data Source Row" or "Add a new Data Source Row" to update or add rows in the data source.
Note: TDM Data Mapping supports character data, including foreign accent words.
Auto Mapping
Auto Mapping supports downloading a template for the test case to configure all mappings in bulk. Only Action Types: Input, Verify, PageInit, and Clicks are supported with Auto Mapping. Other Action Types must be manually mapped.
Auto Mapping is related to test case configuration. Auto Mapping provides the ability to download a template for test cases, allowing users to configure multiple mappings in bulk, all at once, or pick only specific actions necessary to data-drive a test flow. The supported mappings in Auto Mapping are specifically related to actions performed during testing. These supported actions include:
-
Input: This refers to entering input values or data into various fields or elements of an application under test during testing
-
Verify: This action involves verifying or checking the expected results or outcomes of a test against the actual results obtained during testing
-
PageInit: Page initialization refers to the setup or initialization of a page or application before performing specific test actions
-
Clicks: This action involves performing mouse clicks on different elements or buttons within an application under test during testing
Auto Mapping simplifies the process of configuring mappings for these actions by providing a template that can be downloaded and used to set up the mappings in bulk, rather than configuring them individually. This feature can save time and effort in test case mapping setup and configuration.
How to Auto-Map a Data Source to a Test Case
-
Open Data Source List:
- Click the TDM button to open the available Data Source list.
- Click the TDM button to open the available Data Source list.
-
Select Data Source:
- Select the Data Source to map to the test case.
- Select the Data Source to map to the test case.
-
Auto Mapping Workflow:
- The Auto Mapping workflow will open to the action matching the first column of data. Confirm the column matches the test action, the Mapping Type, and then click Attach.
Note: You may click Attach All to map the data source without confirming each action.
- The Auto Mapping workflow will open to the action matching the first column of data. Confirm the column matches the test action, the Mapping Type, and then click Attach.
-
Continue Mapping:
- Attach Columns to all selected mapped actions and then click Done.
- Attach Columns to all selected mapped actions and then click Done.
-
Review Mapping:
-
Review the Mapping, view by Mapped Columns, Missing Columns, Unified View, and click OK.
-
Mapped Columns:
-
Missed Columns: columns in Data Source not mapped to a test action
-
Unified View:
-
-
Edit Mapping:
- 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 the mapping.
- 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 the mapping.
-
View Mappings:
- All Data Sources mapped in a test case will display on the Test Details page.
- 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.
How to Manually Map Data
-
Select Action:
- Select the action and expand to see Action Details.
- Select the action and expand to see Action Details.
-
Add Test Data:
- Click Add Test Data.
- Click Add Test Data.
-
Select Data Source:
- Select the Data Source or add a new one as needed.
- Select the Data Source or add a new one as needed.
-
Select Column:
- Select the column that you'd like to map to the action.
Note: If the column value is blank, the attribute mapped will be set to 'blank'.
- Select the column that you'd like to map to the action.
-
Select Mapping Type:
- Select Read or Write Mapping Type and click Next.
-
Set Attribute:
- Select the attribute to map for this test action. The current value of that attribute will be shown under Default Value.
Note: If a random value was selected in the test case, you may see something similar to [functionizeappType].
- Select the attribute to map for this test action. The current value of that attribute will be shown under Default Value.
-
Save Mapping:
- Click OK to save the mapping.
-
Edit Mapping:
- The mapping is now visible in the action footer. Click the label to edit the mapping or remove it by clicking the x.
- The mapping is now visible in the action footer. Click the label to edit the mapping or remove it by clicking the x.
Manual Mapping in Slider View
You can also add, edit, and delete mappings in Slider View the same as on the Test Detail page.
-
Open Action Settings:
- Click the gear icon on the action to open Action Settings.
- Click the gear icon on the action to open Action Settings.
-
Add Test Data and Select Data source:
- Click Add Test Data.
- Select the Data source or add a New one
- Click Add Test Data.
-
Select Column and Mapping Type:
- Select the Column, Mapping Type, and Data Source Row instructions as above, and then click Next.
- Select the Column, Mapping Type, and Data Source Row instructions as above, and then click Next.
-
Set Attribute:
- Set the Attribute for the action and click OK.
- Set the Attribute for the action and click OK.
Add a Data Source within a Test Case
-
Open a Test in a Project:
- Click the TDM button.
- Click the TDM button.
-
Add a Data Source:
- Click Add a data source.
- Click Add a data source.
-
Create Data Source:
- In the Create Data Source modal, give the new source a meaningful name and select the file type.
- In the Create Data Source modal, give the new source a meaningful name and select the file type.
-
Upload File:
- Upload your file and click Submit.
- Upload your file and click Submit.
-
Select Data Source:
- Your new Data Source will be in the list for selection.
- Your new Data Source will be in the list for selection.
Conclusion
By following these steps, you can efficiently manage and utilize data sources in Functionize, ensuring your tests run in the appropriate context, providing reliable and accurate results.