Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It can happen that during, for example, migration projects, field names or the structure of the payload may change. The new interface can also generate values in a different order. To be able to execute test cases in such scenarios, you can take advantage of the transformation functionality.

XSLT Transformation can be applied on both Input and Output payloads . XSLT Transformation and will be stored in a reference test case. This test case will be used afterwards afterward in Automation Object Configuration.

Apart from the example below, there is a separate page with the most common solutions: XSLT transformation examples

...

Let’s take as an example Interface for Sales Order creation. For some reasons, the structure of the payload message was changed:

  • the node ‘Quantity’ is now reflected by the node ‘Qty’‘Qty,

  • the node ‘ProductName’ is now reflected by the node ‘Product’.

If we execute such a test case (with a different payload structure), it will surely fail since Qty and Product fields are not mapped correctly:

...

Differences between the Reference and Current Execution:

...

We can apply an XSLT transformation to solve this issue.

...


Choose parameters based on your requirements (you can use all of them at the same time). In our example, we are using XSLT_INPUT as we need to apply a transformation to the input payload.


It is also possible to run multiple XSLT transformations at a single stage (e.g., XSLT_INPUT). To achieve this, maintain multiple additional parameters with the same Parameter name and different value values in the Group column. Value from in the Group column will be used to sort the transformations and run them in a particular order.

  1. In the Parameter Value column, enter the test case that stores XSLT transformation (the test case created in step 1.). Save the configuration.

Let’s execute our main test case once again (with XSLT transformation).

...

Test The test case has been executed correctly. As you can see in the Execution Information input message was mapped by xslt the XSLT program, which is stored in a test case 17461.

By using Using appropriate XSLT mapping, you can solve many issues with differences between XML structures in input/output payloads.

...