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?
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?
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()
Set accessibilityLabel
instead of accessibilityIdentifier
.
accessibilityLabel
is what is read out by Voice Over. It's a terrible idea setting this as an ID as the OP wants. I too would like to use the accessibilityIdentifier as I need to test in different languages so I cannot rely on the buttons label or set the accessibilityLabel
to an ID. –
Lam © 2022 - 2024 — McMap. All rights reserved.