I think its trying to synthesize an event while the app is still loading cells
If you dont want to change how the app works you can force it to wait until all the cells are loaded.
Here's a helper funciton I wrote:
func waitForTableCellsCountExact(appUI_Element: XCUIElementQuery, exactly: UInt) {
let x = appUI_Element
expectationForPredicate(NSPredicate(format: "count == \(exactly)"), evaluatedWithObject: x, handler: nil)
waitForExpectationsWithTimeout(30, handler: nil)
}
i.e If you know there should 50 cells present in your table view
waitForTableCellsCountExact(app.tables.cells, exactly: 50)
set a breakpoint at the failure and use the debugger to find how many cells are loaded
po XCUIApplication().tables.cells.count
wait a little and do it again
po XCUIApplication().tables.cells.count
If the number doesnt change that should give you a good indication of the number of cells to wait for before proceeding.
if it does change wait for a few minutes then check again. If your app is loading cells continuosly forever this wont work, but you probably shouldnt be loading cells forever anyway