Adds a handler to the current context.
- Xcode 7.2+
An explanation of the behavior and purpose of this handler, mainly used for debugging and analysis.
A handler block for handling asynchronous UI interruptions such as alerts and other dialogs. Handlers should return
trueif they handled the UI,
falseif they did not. The handler is passed an
XCUIElementrepresenting the top level UI element for the alert.
Returns a token that can be used to unregister the handler. Handlers are invoked in the reverse order in which they are added until one of the handlers returns true, indicating that it has handled the alert.