I have recently began expanding the test functionality of my project by adding some automated tests. So far I have written a handful of tests in my app without much trouble until I got to one specific feature in my app. I was having issues finding static texts on the page once I had navigated to the view controller. I went to call print(XCUIApplication().debugDescription)
my automated test crashed printing the error:
Assertion Failure: <unknown>:0: UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error -25204 getting snapshot for element <AXUIElement 0x7f8227201250> {pid=10986}" UserInfo={NSLocalizedDescription=Error -25204 getting snapshot for element <AXUIElement 0x7f8227201250> {pid=10986}}
To give you some perspective of my view controller it has a navigation bar, segmented control that changes the content of a table view that has some basic text in the cells. Also there is a few other labels on the view controller that is separate from the table view.
I have pretty much tried all the basic XCode troubleshooting like cleaning my project, restarting XCode, etc. with no luck. If anyone has any idea what is going on it would be much appreciated.
I have faced the same issue, I think debug tools are having big issues sometimes, I use XCUIApplication().debugDescription, without the print value, but sometimes only works with print. To fix it, I switched to AppCode, any way it also fail, but less frequently.