So I am trying to get
You can give the button an AccessibilityIdentifier, which is a property that will only be read by the UI Tests and which does not require there to be any readable text.
You can also give the button an AccessibilityLabel, which will enable your button to be used by people who are using accessibility, such as with screen readers or other such devices.
Both of these properties can be read by the XCUIElementQuery, which means you will be able to use, e.g.,
In order to do this, you set the accessibilityIdentifier / accessibilityLabel explicitly in code (
button.accessibilityIdentifier = "slide_out", for example) or in the Storyboard (under properties; see screenshot).