Steer tree Module Attributes

You can create a tree Module Attribute from XML or JSON messages.

To steer a tree Module Attribute, follow the steps below:

  1. Go to your XTestStep and select the Module Attribute.

  1. In the Value dropdown menu, enter tree and the name of the buffer.

  2. Set an ActionMode as described in chapter "ActionModes".

    If you use the ActionMode Insert or Verify for JSON messages, the name of the root node in the Value column must be the same as in the message payload.

Work with tree

In this example you create a tree buffer from an XML structure.

To do so, create a tree Module Attribute from the security token in the message and its nodes in Tosca Commander.

Add Module Attribute SecurityToken

Go to your XTestStep and select the Module Attribute. In the Value dropdown menu, enter tree and the name of the buffer.

Select Buffer from the ActionMode dropdown menu.

Add values tree and buffer name

The TestCase is now ready to be run. Tosca verifies the inserted values.

TestCase with tree buffer in ScratchBook

In this example you create a tree buffer from a JSON structure.

To define the correct path for the tree Module Attribute, add the root element of the message as a Module Attribute in Tosca Commander.

Add Module Attribute item

Create a tree Module Attribute from the address in the message and its nodes.

Add Module Attribute Address

Go to your XTestStep and select the Module Attribute. In the Value dropdown menu, enter tree and the name of the buffer.

Select Buffer from the ActionMode dropdown menu.

Add values tree and buffer name

The TestCase is now ready to be run. Tosca verifies the inserted values.

TestCase with tree buffer in Scratchbook