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, to verify the content of an attachment.
If you want to verify the number of attachments in your message, you can use result count.
To steer your attachment Module Attributes, follow these steps:
-
In Tosca Commander, go to the XTestStep that contains your attachments.
-
Select the attachment that you want to steer.
-
Add the ActionProperty File and the file path in the Value column.
-
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.
-
![]() |
In this example, you want to verify an attachment in your response message. This is, you want Tosca to verify that the content of a file match the value of the attachment Module Attribute. First, you create an attachment Module Attribute. Then you navigate to the XTestStep. Select the attachment and add the ActionProperty File and the file path to the Value column. To verify that the content of the file match the value of the Module Attribute, set the ActionMode to Verify.
Verify Attachment_1 You can now run your TestCase. |
![]() |
In this example, you want to save the attachment in a response message to file. The attachment name is dynamic; it changes with every request. First, you create an attachment Module Attribute. Then you navigate to the XTestStep. Select the attachment and add the ActionProperty File and the file path to the Value column. Since you don't know the exact name of the file, you use a wildcard (*) in the file path. To save the file, you set the ActionMode to Select.
Save attachment with a dynamic name You can now run your TestCase. |