I have a mobile ios app, which generates elements dynamically, i am struggling on clicking some checkboxes because they do not have an id or value like a common checkbox in web application, please look at the image below. (sorry i can't show all image, but app is in development)
Appium inspector gives me the xpath, but i do not like it because it changes depending on which elements are seen on the screen, since i have to scroll down the page, depending on the device, sometimes some checkboxes are displayed sometimes they are not, so the [4] element for example will change.
I want to know if there is a way to click the checkbox by concatenating the text adjacent to the checkbox, so that way it does not matter how many checkboxes are displayed on screen, it will always check by text.
so at the end i have an xpath something like:(//XCUIElementTypeButton[@name="checkbox unselected"])[and text='The hydraulic system was operational']