In Xcode 9.3, when I try to run UI test cases it started giving me below exception where ever it found lengthy messages exceeding 128 characters -
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid query - string identifier "lengthy message more than 128 characters..." exceeds maximum length of 128 characters. You can work around this limitation by constructing a query with a custom NSPredicate that specifies the property (label, title, value, placeholderValue, or identifier) to match against.'
Workaround given is to use custom NSPredicate something like below,
let predicate = NSPredicate(format: "label BEGINSWITH 'Empty '")
let label = app.staticTexts.element(matching: predicate)
XCTAssert(label.exists)
But If we use predicate like above, we might not be able to assert the entire text message.Is there any other possible way where we can assert the entire text? Please let me know.
Thanks, Cheers:)