We're seeing an accessibility error at several points in our tests
Failed to get list of active applications: Accessibility error kAXErrorServerNotFound from AXUIElementCopyMultipleAttributeValues
This was working previously. We didn't do any significant iOS updates on the devices, so I'm not sure what could have changed.
One example is setting the device orientation:
UIDevice.shared.orientation = .portrait
When I break in the debugger at that point I also see the error when I try
po XCUIDevice.shared.orientation = .portrait.
If I try a second time then it works fine, but the first call always fails which causes the test to fail.
There are some other calls which behave similarly. First call always fails with the error above, second call is fine. They're not throwing an exception, so I can't handle it with a do/try/catch.
Is there an accessibility setting that needs to be made manually on the iOS device for this to work?