I posted [Appium][xcuitest]Compare getting outputs speed of source format before. Today, I would like to dive a bit more.
The description shows debugDescription of available elements. So, how to get the available elements ?
That is allElementsBoundByAccessibilityElement
Immediately evaluates the query and returns an array of elements bound to the resulting accessibility elements.
In fb_descriptionRepresentation, it used as below. Then, all of available debugDescription return to the client.
- (NSString *)fb_descriptionRepresentation
{
NSMutableArray<NSString *> *childrenDescriptions = [NSMutableArray array];
for (XCUIElement *child in [self childrenMatchingType:XCUIElementTypeAny].allElementsBoundByAccessibilityElement) {
[childrenDescriptions addObject:child.debugDescription];
}
// debugDescription property of XCUIApplication instance shows descendants addresses in memory
// instead of the actual information about them, however the representation works properly
// for all descendant elements
return (0 == childrenDescriptions.count) ? self.debugDescription : [childrenDescriptions componentsJoinedByString:@"\n\n"];
}