How to check UITableView on XCUITest

there is.

I am writing a XCUITest test code. I want to check out a UITableView. But I could not check now on a UITableView. I do not know why the cell key has no answer.

I wrote the following code.

let tablesQuery = app.tables
    app.tables.cells.staticTexts["山手線"].tap()
    tablesQuery.staticTexts["山手線"].tap()
    tablesQuery.staticTexts["山手線"].tap()

    tablesQuery.staticTexts["渋谷"].tap()
    tablesQuery.staticTexts["大崎"].tap()
    tablesQuery.staticTexts["山手線"].tap()

Viewed is the next capture.

enter image description here enter image description here

And my test code throws the following error. enter image description here

There is a UITableView on this page. I do not know why the cell key has no answer.

What is the problem?

0
source share
1 answer

I decided it myself. I have established the availability of something.

        self.workview.isAccessibilityElement = true
    self.workview.accessibilityLabel = "workview"

after I comment on the code above, I could check.

Thank!

0
source

Source: https://habr.com/ru/post/1653675/


All Articles