What causes Error -25204 getting snapshot for elem

2020-06-01 09:26发布

问题:

I am getting following error during a UI test (using simulator for iPhone 6):

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

<unknown>:0: error: -[*screen name*] : UI Testing Failure - Failure
getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error
-25204 getting snapshot for element <AXUIElement 0x7fbd6be217d0> {pid=6874}" UserInfo={NSLocalizedDescription=Error -25204 getting
snapshot for element <AXUIElement 0x7fbd6be217d0> {pid=6874}}

The scene is similar to other scenes where UI testing works correctly. So, I am not sure why there is an error getting snapshot for some element.

I checked using Accessibility Inspector, and all elements seem to have an identifier.

This with Xcode Version 7.3 (7D175).