XCUIElementQuery Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | XCUIElementTypeQueryProvider |
| Declared in | XCUIElementQuery.h |
element
Returns an element that will use the query for resolution.
@property (readonly) XCUIElement *elementDeclared In
XCUIElementQuery.h
count
Evaluates the query at the time it is called and returns the number of matches found.
@property (readonly) NSUInteger countDeclared In
XCUIElementQuery.h
– elementAtIndex:
Returns an element that will resolve to the index into the query’s result set.
- (XCUIElement *)elementAtIndex:(NSUInteger)indexDeclared In
XCUIElementQuery.h
– elementMatchingPredicate:
Returns an element that matches the predicate.
- (XCUIElement *)elementMatchingPredicate:(NSPredicate *)predicateDeclared In
XCUIElementQuery.h
– elementMatchingType:identifier:
Returns an element that matches the type and identifier.
- (XCUIElement *)elementMatchingType:(XCUIElementType)elementType identifier:(nullable NSString *)identifierDeclared In
XCUIElementQuery.h
– objectForKeyedSubscript:
Keyed subscripting is implemented as a shortcut for matching an identifier only. For example, app.descendants[“Foo”] -> XCUIElement.
- (XCUIElement *)objectForKeyedSubscript:(NSString *)keyDeclared In
XCUIElementQuery.h
allElementsBoundByAccessibilityElement
Immediately evaluates the query and returns an array of elements bound to the resulting accessibility elements.
@property (readonly, copy) NSArray<XCUIElement*> *allElementsBoundByAccessibilityElementDeclared In
XCUIElementQuery.h
allElementsBoundByIndex
Immediately evaluates the query and returns an array of elements bound by the index of each result.
@property (readonly, copy) NSArray<XCUIElement*> *allElementsBoundByIndexDeclared In
XCUIElementQuery.h
– descendantsMatchingType:
Returns a new query that finds the descendants of all the elements found by the receiver.
- (XCUIElementQuery *)descendantsMatchingType:(XCUIElementType)typeDeclared In
XCUIElementQuery.h
– childrenMatchingType:
Returns a new query that finds the direct children of all the elements found by the receiver.
- (XCUIElementQuery *)childrenMatchingType:(XCUIElementType)typeDeclared In
XCUIElementQuery.h
– matchingPredicate:
Returns a new query that applies the specified attributes or predicate to the receiver.
- (XCUIElementQuery *)matchingPredicate:(NSPredicate *)predicateDeclared In
XCUIElementQuery.h
– matchingType:identifier:
- (XCUIElementQuery *)matchingType:(XCUIElementType)elementType identifier:(nullable NSString *)identifier– containingPredicate:
Returns a new query for finding elements that contain a descendant matching the specification.
- (XCUIElementQuery *)containingPredicate:(NSPredicate *)predicateDeclared In
XCUIElementQuery.h
– containingType:identifier:
- (XCUIElementQuery *)containingType:(XCUIElementType)elementType identifier:(nullable NSString *)identifier debugDescription
@discussion Provides debugging information about the query. The data in the string will vary based on the time at which it is captured, but it may include any of the following as well as additional data: • A description of each step of the query. • Information about the inputs and matched outputs of each step of the query. This data should be used for debugging only - depending on any of the data as part of a test is unsupported.
@property (readonly, copy) NSString *debugDescriptionDeclared In
XCUIElementQuery.h