Creating schema-specific data masks
In the Recording Studio perspective or the Schema Library view of the Architecture School perspective, you can create a schema-specific data mask in your HCL OneTest™ API project. The mask will replace sensitive data in specified fields in messages recorded against the schema and, thus, prevent that data from appearing in any assets created from those messages.
About this task
If permissions in HCL OneTest™ API are being used to control which users can create, modify, or delete data masks, you may require permissions before you can create a data mask.
When
creating a schema-specific data mask, there are three possible data
masking methods that can be used:
- Creating a fixed value substitution data mask involves entering a value to mask the "real value" of a field and that value will replace any data recorded for that field.
- Creating a data source substitution data mask involves using a
data source, such as a Microsoft™ Excel
spreadsheet or a .csv file, to supply a list of values that can be
used to replace recorded data.Note: Before you can create a data source substitution data mask, you must complete the following tasks:
- Create a spreadsheet or a .csv file that contains a series of "fake" values that you want to use to mask real values of the relevant message element.
- In the Test Factory perspective, create a new Excel data source and select the spreadsheet or .csv file that you created.
- Creating an automatic value creation data mask involves selecting or creating a regular expression (Regex) and HCL OneTest™ API will create new values that match that expression.
Note: This topic describes only the Schema Library method
of creating a schema-specific data mask.
Procedure
- Open the Schema Library view of the Architecture School perspective.
- On the left side of the view, select the relevant schema category.
- Under Schemas, select the relevant schema.
- In the Operation list on the Config tab, select the relevant operation.
- Select the text node of the relevant message element.
- Click the Data Masking tab (if required).
- Click Add.Note: A mask icon is displayed next to the selected message element.
- In the Masking Technique list, click
the required option:
- Click Save.
Results
To verify that the new data mask works, use Recording Studio
to record and view new events. On the Events View window, double-click
a recorded event for the relevant operation:
- If you selected fixed value data substitution, verify that the value of the relevant message element has been replaced by the value that you entered for the data mask.
- If you selected data source substitution, verify that the value of the relevant message element has been replaced by a fake value from the specified data source. If you record more events, you should notice that the fake values displayed change as the real values change.
- If you selected automatic value creation, verify that the value of the relevant message element has been replaced by a fake value from the specified Regex. If you record more events, you should notice that the fake values displayed change as the real values change.