A captured image of a screen, app, or UI element state.
- Xcode 9.0+Beta
Screenshots capture the current UI state of classes that conform to the
XCUIScreenshot protocol, such as
XCUIElement. Each screenshot contains an image representation of the captured UI at the point the screenshot was taken.
You can attach a screenshot of your app's UI to a test or activity to store it for later analysis. Create an attachment for a screenshot by calling
init(screenshot: initializer, then add the attachment to a test or activity via
add(_:) method. For more information, see Adding Attachments to Tests and Activities.