Skip to content

setAttachmentScreenshot (Team Notifications, Alerts and Collaboration)

Compatible with:
  • Purpose
  • This command is used to set a 'Screenshot' captured during the automated test run (within which the script containing this command executes within) as an attachment to the email.  

    The input to the 'target' field of this email is the 'identifier' for a test instruction in the same test run that the test script containing this command is executing within (identified by use of one of the commands that starts with ' getIdentifierFor '), that has a screenshot captured, that you want to attach to the email being composed.
     
    The screenshot is a screenshot that is captured within the same test run (not necessarily within the same test script) within which the email is being composed and has to correspond to a test instruction that is executed before the test instruction that executes this command.

    Worksoft SaaS does not impose any restriction on the number of attachments that can get attached to the email body (name), including screenshots. 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 file format for the screenshot attachments will be jpeg (.jpg).

    The name of the file attachments (files) will be set to the global id of the test instruction within the automated test that the screenshot corresponds to (as it appears in the test execution results screen) within the Worksoft SaaS application.  

    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 instruction id that is returned from any of the getIdentifier commands does NOT have a screenshot captured (either because the screenshots are disabled for the test run OR because test runs are enabled only on failure but that instruction did not experience failure) and that instruction Id is passed as input to this command, then the instruction will fail with a message:"The instruction passed as input into the 'target' field of this test instruction does not have a screenshot captured."
    Also, please note that to capture the screenshot(s), the Screenshot Capture mode should be either "All Instructions-Real Time" or "On Error-Real Time".
  • Syntax
  • setAttachmentScreenshot( InstructionIdentifer)
  • Target
  • InstructionIdentifer (Instruction number of the screenshot taken)
  • Value
  • N/A
  • Return Value
  • N/A



 

Feedback and Knowledge Base