Contents

firstMatch

The first element that matches the query.

Declaration

var firstMatch: XCUIElement { get }

Discussion

Use the firstMatch property when you know that there can only be one possible match for an element query. When you call firstMatch, the framework stops traversing your app’s accessibility hierarchy as soon as it finds a matching element, speeding up element query resolution.

See Also

Related Documentation