2020-03-20a few seconds read (About 70 words)How to iterate over XCUIElementQuery in UITestsIssue #628 123456789101112131415161718192021222324252627extension XCUIElementQuery: Sequence { public typealias Iterator = AnyIterator<XCUIElement> public func makeIterator() -> Iterator { var index = UInt(0) return AnyIterator { guard index < self.count else { return nil } let element = self.element(boundBy: Int(index)) index = index + 1 return element } }}extension NSPredicate { static func label(contains string: String) -> NSPredicate { NSPredicate(format: "label CONTAINS %@", string) }}let books = app.collectionViews.cells.matching( NSPredicate.label(contains: "book"))for book in books {}#swifttesting