Search code examples
iosswifttestingxcode-ui-testinguitest

Swift UITest - One of the two will be used. Which one is undefined


I'm trying to make some UITests, and I'm having annoying problem.

When I try to get a tableView/tableCell, I recieve this text in log and my test fail.

objc[18223]: Class VCWeakObjectHolder is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/Frameworks/ViceroyTrace.framework/ViceroyTrace (0x131ad04d0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/AVConference (0x131797e38). One of the two will be used. Which one is undefined.

That's the code that I'm using to make test:

let app = XCUIApplication()
let table = app.tables

let cell = table.cells.element(matching: .cell, identifier: "cell_settings_1")
_ = cell.waitForExistence(timeout: 10.0)
cell.tap()

XCTAssert(app.otherElements["view_about"].exists)

My tableViewCell has this string as identifier, that's not the problem.

When I try to record test, I receive this error:

Error

Someone could help me?


Solution

  • After so many time I discovered my error.

    The problem was that I put an accessibility Identifier in parent of a view.. and then, the itens inside then will never work properly.

    That's an image:

    enter image description here

    So, in image case, nothing inside "view_about" will be detected by tests (even recorder).