The problem is when I try to access back bar button item because it is presented with:
Restaurants
title,Back
title- without title
Like it is on the screens:
Currently I access it like this:
let backButton = XCUIApplication().buttons["Restaurants"]
but it won't work for other cases. It is not universal way. May I somehow set it accessibilityIdentifier or something else?
Best Answer
Generally the back button tends to be the first button element in the navigation bar