{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1779,"path":"application-development/automated-test-framework-atf/attachment-test-steps.md","title":"Attachment test steps","bundle":null,"doc_type":null,"release":"australia","body":"\n# Attachment test steps\n\nTest an attachment-dependent business rule by uploading an attachment either from a form or from a server-side API call. For example, you can have a business rule that doesn't let you close an incident without an attachment such as a screenshot.\n\n-   **Upload from form**\n\n    As a UI test step, the upload attachment step requires navigation to a form, which you can open using either **Open a New Form** or **Open an Existing Record**. Use **Upload Attachments** to select from the attachments that the test step adds to the form. When you select attachments to add to a form, the system waits to load the attachments before proceeding to the next test step. For more information on UI test dependency and wait mechanism, see [UI test steps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/ui-test-steps.md).\n\n-   **Upload from Server API**\n\n    As a Server test step, the upload attachment step has no UI dependencies. Use **Upload Attachments** to select from the attachments that the test step adds to the record. When you select attachments to add to a form, the system waits for the attachments to be loaded before proceeding to the next test step. For more information, see [Server test steps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/server-test-steps.md).\n\n\n## Design considerations\n\nFollow these design considerations for attachment test steps:\n\n-   All attachment steps require adding one or more attachments.\n-   The system rolls back any attachments by the step after the test completes.\n-   The system cannot roll back any existing attachments after the test completes.\n-   Avoid testing records with existing attachments to eliminate data dependency.\n-   If UI testing is involved, add the attachment to a form.\n-   When no UI is involved, add the attachment to the Server API.\n\n**Parent Topic:**[Building and running automated tests with the Automated Test Framework](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/atf-build-overview.md)\n\n"}}