UI Testing Failure - Failure getting snapshot

UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error -25201 getting snapshot for element


I'm getting this error when first attempting to query a table view. The table view only has about 30 cells but they contain content that's loaded asynchronously. It's intermittent, and doesn't happen all the time, but frequent enough that it causes a serious problem with automated UI tests. Even with hard-coded sleeps that are definitely long enough to allow all content to finish loading, it doesn't seem to prevent this error from occuring.

Accepted Reply

The issue is caused by having a NSMutableAttributedString with custom attributes in the hierarchy when testing.


rdar://25623858

  • Same problem with Xcode = 14.2 + Simulator = 14.2 There are several other errors out there that appear only with the Simulator, but not with the real App. Is this Snapshot Error among them?

Add a Comment

Replies

Is there any fix for this? I still get the issue on iOS version 10.2 and Xcode 8.2...

Looking for a fix for this! Seeing it with a large table, here is the error:


Assertion Failure: 
<unknown>:0: UI Testing Failure - 
Failure getting snapshot Error 
Domain=XCTestManagerErrorDomain 
Code=9
 "Error -25204 getting snapshot for element <AXUIElement 0x7fadcc7103f0> {pid=68881}" 
UserInfo={NSLocalizedDescription=Error -25204 getting snapshot for element <AXUIElement 0x7fadcc7103f0> {pid=68881}}

HI, Any fix for this issue?

I experience the same issue (with a NSMutableAttributedString in my UITableViewController hinders me switching to another tab) with XCode 8.2.1, is there a easy workaround known?

Interesting. Any idea how do I find if and where I have instances of NSMutableAttributedString in the hierarchy?

Have you solved your problem?