Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find UIView with accessibilityIdentifier in UITests Target

I'm trying to find a UIView element with navigationBar accessibilityIdentifier in test target in order to check the isEnabled state.

Have tried the different solutions, but couldn't find the needed one. Is there a way to achieve what a want?

Tried this solution: application.groups.matching(identifier: "navigationBar") - doesn't work.

like image 811
Nikita Ermolenko Avatar asked Feb 28 '18 08:02

Nikita Ermolenko


1 Answers

Regular views can be queried using otherElements.

let app = XCUIApplication()
app.otherElements["navigationBar"]
like image 148
Oletha Avatar answered Oct 24 '22 04:10

Oletha