UITesting Failure getting list of active applicati

2019-05-30 05:55发布

问题:

There is a button by clicking on the button it opens facebook login page and clicking on the done button it gets back to the main view controller.

Here is the code which I got by recording

 override func setUp() {
        super.setUp()
        XCUIApplication().launch()

 }

func testExample() {

        let app = XCUIApplication()
        app.buttons["Button"].tap()
        app.buttons["Done"].tap()
}

But when I run the recording it gives error in the second line of testExample() Here is the error: UI Testing Failure - Failure getting list of active applications: AX error -25205

回答1:

Be sure to "Enable UI Atomation" on the device (Settings > Developper).

(I had to restart my device to make it effective)