UI Testing Failure due to failed AX Action

When I run a UI Test in Xcode 7, the line XCUIApplication().launch() causes the test to fail under the "Wait for app to idle" step:


UI Test Activity:

Assertion Failure: UI Testing Failure - Failed to perform AX action for monitoring the animations of Target Application, error: Failed to perform AXAction 2043 after 30 retries: kAXErrorServerNotFound (see <rdar://problem/15530121>)


Any idea what might be causing this failure?

Post not yet marked as solved Up vote post of kaguilar Down vote post of kaguilar
11k views

Answers

I am having the same issue, but later in my testing than in launch. Nothing is happening in my app that should be preventing the test from proceeding. If I record the app, it is able to move past but not when it runs the test or any variation of it. The line that fails for me is a button press. It correctly identifies the button but fails when I try to tap the button.


t = 46.93s Tap the "dropbox files" Button

t = 46.93s Wait for app to idle

t = 76.95s Assertion Failure: UI Testing Failure - App failed to quiesce within 30.0s

/xxxxxxx.swift:57: error: -[XXXUITests.XXXXUITests testDropbox] : UI Testing Failure - App failed to quiesce within 30.0s

Try removing your app from the simulator and rerunning the tests with a clean version of your app. It solved the problem for me

I was having exactly the same issue:

t = 12.56s Assertion Failure: UI Testing Failure - Failed to perform AX action for monitoring the animations of Target Application 0x7fd16bd31d10, error: Failed to perform AXAction 2043 after 30 retries: kAXErrorServerNotFound


resetting the simulator and cleaning and building fresh didn't seem to be helping at all though.. for reasons not entirely obvious to me though refactoring :


class UITests: XCTestCase {
    let app = XCUIApplication()
    override func setUp() {
        super.setUp()
        continueAfterFailure = false
        app.launch()
    }

to:

class UITests: XCTestCase {
    override func setUp() {
        super.setUp()
        continueAfterFailure = false
        XCUIApplication().launch()
    }


cleared it up entirely, I havent successfully replicated the issue in a sample project yet but maybe this will help someone else.