I need to access following button:
This line works fine:
app.buttons["Reorder 1, $27 000, LondonStreet, ok, Pending"]
but this don't:
app.buttons.elementMatchingPredicate(NSPredicate(format: "accessibilityTitle BEGINSWITH[cd] %@", "Reorder 1"))
I need to access following button:
This line works fine:
app.buttons["Reorder 1, $27 000, LondonStreet, ok, Pending"]
but this don't:
app.buttons.elementMatchingPredicate(NSPredicate(format: "accessibilityTitle BEGINSWITH[cd] %@", "Reorder 1"))
Copyright © 2021 Jogjafile Inc.

When finding elements via predicates you must use the
XCUIElementAttributesProtocol. For this example, I don't thinktitlewill actually work, but try usinglabel(which should map toaccessibilityLabel).For some reason the
%@format option doesn't seem to work in Swift. Also note the extra single quotes around "Reorder 1".