You can use test cases to automate the testing of an integration or data migration setup. For each message, you can create the desired test cases.
This topic explains how to create a test case for an export message; the message source document is an internal document.


Standard procedure

1. Click Connectivity studio Integration Design.
2. On the Message tab, in the list, find and select the desired export message.
3. Click Edit.
4. On the Action Pane, click Design.
5. Click Test case.
6. Click New.
7. In the Name field, type a value.
8. If you have defined file actions for your target connector, you can skip the file actions. As a result, the created file stays in the Working folder.
  Select Yes in the Skip file action field.
9. You can enter a description for the test case. For example, describe its purpose.
  In the Note field, type a value.
10. Sub-task: Define test data range.
  10.1 Define which data in the D365 FO environment is used in the test case.
  Expand the Range section.
  10.2 Click New.
  10.3 Select the record of the source document that is used to define the test data range.
  In the Document field, enter or select a value.
  10.4 Select the field of the selected source document record that is used to define the test data range.
  In the Record field field, enter or select a value.
  10.5 Define the range type that applies to the Range field. You can apply ranges of these types:
- Value: Enter a fixed value or a range of values using the advanced query syntax.
- Custom: Enter a static method that defines the range. For example, you can use the SysQueryRangeUtil class to apply advanced date queries. Other examples are: 'curExt()' (gets the current company), 'strFmt("%1..%2", prevMth(today()), today())' (gets the orders from the last month), and 'DateTimeUtil::utcNow()' (filters on the current date/time).
  In the Range type field, select an option.
 

Note: The Parameter type is not applicable here.

  10.6 Enter the range in line with the selected range type.
  In the Range field, enter or select a value.
11. Sub-task: Set up test steps with the expected results.
  11.1 Expand the Test steps section.
  11.2 Click New.
 

Note: You can also use the Create expected result function. The test steps are automatically added based on the message field mapping. The expected results are filled in, based on the defined data range. For each record in the range, a separate set of test steps is added with the related expected results. These sets of test steps are distinguished by the target record number; each set gets its own number.
If added, you can manually change the test steps as desired.

  11.3 For informational purposes, enter a name or short description of the test step.
  In the Test name field, type a value.
  11.4 From the message mapping, select the target record for which you want to test a field.
  In the Message mapping field, enter or select a value.
  11.5 Select the desired mapped field of the selected target record.
  In the Target field field, enter or select a value.
  11.6 If you want to test several records, use this field to distinguish the record data sets.
  In the Target record number field, enter a number.
  11.7 Define the range type that applies to the Expected result field. You can apply ranges of these types:
- Value: Enter a fixed value or a range of values using the advanced query syntax.
- Custom: Enter a static method that defines the range. For example, you can use the SysQueryRangeUtil class to apply advanced date queries. Other examples are: 'curExt()' (gets the current company), 'strFmt("%1..%2", prevMth(today()), today())' (gets the orders from the last month), and 'DateTimeUtil::utcNow()' (filters on the current date/time).
  In the Expected result type field, select an option.
 

Note: The Parameter type is not applicable here.

  11.8 Enter the expected result for the selected mapped field in line with the selected expected result type.
  In the Expected result field, type a value.
  11.9 Indicate if the test step must be done automatically or manually.
If set to Manual, when the test is finished, a warning is shown in the test case run. You can do the test manually and change the test status accordingly on the test case run.
  In the Execution field, select an option.
  11.10 Select the expected status for the test step. Only use the statuses Failed or Passed. If the test result matches with the expected status, in the test case run, the test step status is set to Passed.
  In the Expected status field, select an option.
12. Close the page.
13. Close the page.
Related to Notes

Test with test cases

 

Provide feedback