<!--
{
  "documentType" : "article",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/activities-and-attachments",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Activities and Attachments"
}
-->

# Activities and Attachments

Split long tests into substeps with activities, and attach output data like files and screenshots.

## Topics

### Activities

[Grouping Tests into Substeps with Activities](/documentation/XCTest/grouping-tests-into-substeps-with-activities)

Simplify test reports by creating activities that organize substeps within complex test methods.

[`XCTContext`](/documentation/XCTest/XCTContext)

A proxy for the current testing context.

[`XCTActivity`](/documentation/XCTest/XCTActivity)

A named substep of a test method.

### Attachments

[Adding Attachments to Tests, Activities, and Issues](/documentation/XCTest/adding-attachments-to-tests-activities-and-issues)

Use attachments to store a test’s output data for later analysis.

[`XCTAttachment`](/documentation/XCTest/XCTAttachment)

Data from a test method’s execution, such as a file, image, screenshot, data blob, or ZIP file.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)