Steer attachment Module Attributes

Once you have created Module Attributes for your API message attachments, you can steer them in your API TestCase. For example, you can verify the content of an attachment.

If you want to verify the number of attachments in your message, you can use result count. For more information on how to do so, see chapter "Set an index, notation or result count ".

To steer attachment Module Attributes in Tosca, follow the steps below:

  1. Go to your XTestStep and select the attachment you want to steer.

  2. Add the ActionProperty File and the file path in the Value column.

    Use the file path of the file you want to insert, save to, or verify against.

Edit attachments

  1. Set an ActionMode.

    • To insert the content of the file into the Module Attribute, use Insert.

    • To save the content of the Module Attribute to the file, use Select.

    • To verify that the content of the file equals the value of the Module Attribute, use Verify.

The ActionProperty File ensures that the file path is resolved. It should be used for all file operations. If you simply add a file path, it is treated as a normal value and not resolved.

In this example you verify an attachment Module Attribute in your response message. This means that you want Tosca to verify that the content of a file equals the value of the attachment Module Attribute.

To do so, you create an attachment Module Attribute.

Then you navigate to the respective XTestStep. You select the attachment and add the ActionProperty File and the file path in the Value column.

Verify Attachment_1

To verify that the content of the file equals the value of the Module Attribute, you set the ActionMode to Verify.

The TestCase is now ready to be run.