Reputation: 61840
Within User Defined Runtime Attributes I set accessibilityIdentifier
's value as browseTabBarButton
.
But when I try to access this from UITests
using:
app.tabBars.buttons["browseTabBarButton"]
UITabBarItem
is not recognized. Why?
Upvotes: 5
Views: 2747
Reputation: 266
If you are trying to access the UITabBarItem
to switch tabs, you can achieve this in a different way by accessing the buttons within the UITabBar
:
app.tabBars.firstMatch.buttons.element(boundBy: 0).tap()
Upvotes: 8
Reputation: 61840
Set accessibilityLabel
instead of accessibilityIdentifier
.
Upvotes: -1