When searching for elements through predicates, you must use the XCUIElementAttributes protocol. In this example, I don't think title really works, but try using label (which should display on accessibilityLabel ).
For some reason, the %@ format option doesn't work in Swift. Also note the extra single quotes around "Reorder 1".
let predicate = NSPredicate(format: "label BEGINSWITH[cd] 'Reorder 1'") let button = app.buttons.elementMatchingPredicate(predicate)
source share