setAttachmentDataFile (Team Notifications, Alerts and Collaboration)
Compatible with:
- Purpose
- This command is used to set a 'Data File' as an attachment to the email.
The data file has to be within the same project the test script belongs to.
The input to the 'target' field of this email is the name & status of the 'data file' along with the attributes(if required). If the status is unspecified, it is assumed to the data file in the 'active' status. When passed, the 'status' must be appended to the data file name in the format <dataFileName>(<status>), where the <dataFileName> should contain the name of the data file and <status> should contain the name of the status [example: (W), (A)]. If you want to have the attributes of the 'data file' as a header, you need to specify "withAttributes" next to the status separated by the pipe symbol. [example: <dataFileName>(W/A) || (withAttributes/withoutAttributes)].
If the Data File passed into the 'target' for this command has in its contents user-defined variables and/or system variables, they will NOT get substituted during the test execution.
Worksoft SaaS does not impose any restriction on the number of attachments, including 'data files', that can get attached to the email body (name). But, the recipient's email server may impose restrictions on the number of email attachments and/or the total file size of attachments. Many email servers restrict email attachments that exceed the total byte size of 40 MB.
The name of the file attachments (data file(s)) will remain the same as the names of the data file(s) in the Worksoft SaaS.
Please note that if data files, files, and screenshots are attached to the email body, then the order in which the attachments will appear in the email that is composed is as follows:
- 'Data Files' first, 'Files' next followed by 'Screenshots'
- Within a file of a particular type (data file or file or screenshot), the files will appear in the order they are attached.
If the 'data file' passed as input to the 'target' field does not exist in the project, during the execution of an automated test, this instruction will fail with a message: "The 'data file' passed as input into the 'target' field of this test instruction does not exist in your project." - 'Data Files' first, 'Files' next followed by 'Screenshots'
- Syntax
- setAttachmentDataFile(DataFileName(status) || withAttributes/withoutAttributes )
- Target
- DataFileName(status) || withAttributes/withoutAttributes (If the status is not provided, by default the data file is considered as Active)
- Value
- N/A
- Return Value
- N/A