Reputation: 7656
I tried
self.searchBar.accessibilityTraits = .searchField
self.searchBar.accessibilityIdentifier = "mySearchBar"
in UISearchController
but it does not work, I need the accessibilityIdentifier to be visible in Appium for UI testing
Upvotes: 0
Views: 503
Reputation: 7656
The solution is to set
self.searchBar.isAccessibilityElement = true
Upvotes: 3