Instance Method

screenshot

Takes a screenshot of a screen or UI element’s current visual state.

Required.

Declaration

- (XCUIScreenshot *)screenshot;

Discussion

The output of this method is equivalent to capturing a screenshot manually on a device. For example, if you take a screenshot of a window on macOS that is covered by another window, the covering window will be visible in the screenshot.