Manage Test Data in SAP S/4HANA Cloud Test Automation Tool
SAP offers the Test Automation Tool for SAP S/4HANA Cloud. The test tool is natively part of the SAP S/4HANA Cloud Quality System. It comes with predefined automatic Test Processes for most of standard business processes. However, sometimes it is necessary to adapt these standard test processes. This was needed in my project experience because of reasons which included, certain part of test process was not needed in customer context, update was needed due to changes UI or additional input data needed to be provided. After Test Process is modified, sometimes it is also needed to adjust binding for Test Data which is used for input and output of Test Process.
In this blog, I will explain how to adjust the data binding in the adapted Test Process. This is based on my experience with the tool. I will also provide reference to other existing blogs where specific topic is explained in further details.
1. Bind Process Fields to Test Data Container Fields
When you adapt the Test Process by making copy of standard one, all existing binding to Test Data Container (TDC) Fields also get copied. So, you may have to do this step only for any newly added actions.
After the Test Process has been adapted, on the ‘Test Process Details’ click on ‘Bind TDC Field’.
You enter the ‘Field Binding’ section. Here, select the Test Process field on left-side and select the TDC Field on the right-side. You will have to expand both sides as needed, to reach the fields. Click on Bind. As a result the value will be mapped under ‘Data Binding’ column.
Save the Changes and exit.
2. Capture Test Output to Parameter
The output generated during test execution by Read actions, for example Sales Document Number, is captured into a Parameter. This Parameter can be provided as input to any further Input actions.
For this you need to record/add an action of type ‘Read’. In the ‘Value’ field, replace the part of string which provides the output value, with wildcard (.*), as shown below. In the ‘Data Binding’ column, provide the name of the Parameter.
3. Different Ways of Input for Action
3.1 Input by Test Data Container
This can be done by ‘Bind TDC Field’ as explained above. In addition, it is also possible to assign TDC field on the Action. To do this, on the ‘Data Binding’ column use search-help. On ‘Bind Field’ pop-up, select option ‘Test Data Container’ and select relevant TDC Field. The value in the field formed as #TDC-<Name of the TDC>-<Name of TDC Field>.
3.2 Input by Parameter
Input by Parameter is provided typically when you want to pass output of one Process Step to next one. For this the Parameter should be defined first as described above. To provide it as input, on the ‘Data Binding’ column use search-help. On ‘Bind Field’ pop-up, select option ‘Previous Step’ and select relevant Parameter. The value in the field formed as #<Process Step ID>-<Parameter Name>.
3.3 Input as Fixed Value
In my customer case, in some cases it was necessary to provide fixed value to the test execution. To do this, you can provide the value to input in the ‘Value’ column.
3.4 Input by System Variable
There are several predefined System Variables. Using these variable you can provide input of timestamp, date, random number etc. To do this, on the ‘Value’ column use search-help and select required System Variable.
You can refer to following documentation on Help Portal for details of all available System Variables.
4. Maintain Values in Test Data Container
Along with standard Test Processes, there are also standard Test Data Containers provided. When you copy the Test Process, the target Test Process maintains the assignment to standard Test Data Container. Each Test Data Container has one standard Variant. You can copy it to create multiple TDC Variant for different data set for test execution.
4.1 Create Custom Variant
On the Test Process, go to tab ‘TDCs’ and click on name of the Test Data Container.
You will be navigated to ‘Test Data Container’ app. Here, select the standard variant and click on ‘Copy’.
On the next pop-up, first you should provide details for the Variant, like Description, Country/Region, Company Code. On the second step, you can provide values for fields which will be provided as input to test execution.
Finally, proceed to step 3, review the values and Save the Variant.
You should provide values at least to the fields which are mapped to Input Actions via binding. If no value is found in TDC for such fields, then blank is provided as value during test execution.