Versions Compared

Key

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

Anchor
XPath
XPath

USE: 

In most cases, eCATT recordings will be added to the test case repository to support interface postings which that require manual actions (and are typically done by users). Usually, these manual steps will generate new business documents in the SAP backend system and these back-end system. These document numbers must be passed to next the following interface test cases in the process chain. In For this purpose, the IFTT variables concept is utilizedused. Next case that its Parent ID will point to eCATT step will have values propagated in Previous Variables 1-5. This will happen thanks to XPath expressions 1-5 that will be defined in this step.The next test case, in which Parent ID points back to the eCATT step, will have values passed by variables declared during ECATT configuration object creation.

Extracting values from the eCATT log

SAP eCATT stores a special log after each script execution. The logs are accessible by through SECATT transaction, and they contain all system responses. The example:

The sample eCATT log of scipt execution that creates outbound deliveryPicture: Sample eCATT execution log that creates outbound delivery,

Technically Technically, the log is stored in the SAP system as an XML message. The native XML content can be displayed by executing function module ECATT_LOG_SHOW_PARAM_XML report and entering the eCATT execution number. As already mentioned, in most cases, there is a need to pass to the next test cases the document numbers that were the number of documents created during current an eCATT test case execution to the following test cases. Usually, standard SAP transactions return the document numbers by through system messages (as presented on the screenshot). if If not, it is possible to read them inside during eCATT recordings (instruction GET).
To fill the variable with such document number first, first we need to define processing parameters for the variable. When we define an XPath expression that will be able to fetch the value from eCATT xml log. The XPath syntax for standard SAP message is followingthe variable processor as ECATT_LOG we need to add an Xpath as the processing parameter. 

The Xpath's task is to point to the exact location of the value we want to pass in our declared variable. Take a look at some basic XPath syntax rules: 


The XPath for standard SAP message should have following syntax:

/GuiScripting/ProcessedScreen/Message[Id="XX"][Number="YYY"]/ParameterZ/text(), where:

...

Z is Parameter number (1,2,3,4)

The node main GuiScripting main node, GuiScripting, is common for all eCATT logs, the other . Other node names are visible in the tree structure in using the regular eCATT log viewer.

Example:

to fetch delivery number that was created by tcode VL01:

/GuiScripting/ProcessedScreen/Message[Id="VL"][Number="311"]/Parameter2/text()


There is also a way to log any custom variables in the eCATT script by code block:

MESSAGE (MSG_1).
   LOGMSG ( LOC_MESG_1 ).
ENDMESSAGE (MSG_2).

Where LOC_MESG_1 contains a local variable as MSGV1:

Image Added


To access it from IFTT the Xpath expression should look like below:
//item[MSGID='ZZZ']/MSGV1/text()

Extracting values from eCATT export parameters

It is also possible to read values directly from eCATT export parameters. This option is available for scripts executed locally on the same system where IFTT is installed.
For this variable processor, ECATT_EXP can be used with parameter name matching eCATT export parameter:

Image Added