A product test team maintains its test data in a master XML file. To test specific features of the product, different test groups require specific test data. Test group A requires data on a specific skill set Java. Test group B requires data on a specific location BLR.
To create different test data files for each test group, the test team uses TDM to create data subsets with the required information.
The master data file contains records of employee and contractor information including name, department, address, office location, and skill set.
The XML source definition file (XSD) defines the structure of the master file and data subset files that you create from the master data file. The XSD file defines the Street, Zip, City, and State elements as child elements of the element Address. The elements Name, Skill, and Address are child elements of the elements Employee and Contractor. Address, Employee, and Contractor are child elements of the element Department.
Ancestor and child relations affect the outcome of a data subset operation.
The following image shows the
Criteria
tab on the file page in Test Data Manager:
To create a data subset that contains employee information for the skill set Java, apply the criteria to the element Skill on the Employee branch. Select the operator as equals. Enter the value on which to filter the data as JAVA. Define the scope as Employee.
Create and run a plan that includes the XSD file and the criteria and scope of the data subset.
The subset operation applies the filter on the element Employee and includes all employees with skills that match the criterion. The data subset file that the workflow creates contains data on all employees with Java skills. Department is an ancestor element of Employee. The subset therefore includes all departments that have employees with Java skills and all child elements of Departments.
Edit the data subset criteria and then run the plan again to create a data subset with the data that test group B requires. Delete the criteria on the element Skill.
To create a data subset of departments located in BLR, apply the filter criteria to the element City. Select the operator as equals. Enter the value on which to filter the data as BLR. Define the scope as Department.
The subset operation applies the filter on the element City and includes all departments with addresses that have cities that match the criterion. The data subset file that the workflow creates contains data on all departments with the city as BLR. The subset includes all child elements of the element Department.