UI tests failing in Xcode 14

675 Views Asked by At

Failed to Error Domain=com.apple.dt.xctest.ui-testing.error Code=10001 "Application is not running"

All of the UI tests were working in Xcode 13 but once I updated to 14, they all failed. Also noted that all unit tests pass and the issue is only with UI tests. I've tried XCUIApplication launch but that didn't help.

1

There are 1 best solutions below

0
Paul Lehn On

I encountered the same error but only on a CI runner (Github Actions). What made it pass was adding app.activate() before app.launch() in the setUp func:

let app = XCUIApplication()

override func setUpWithError() throws {
    continueAfterFailure = false
    app.activate()
    app.launch()
}

Hope this helps!