title: How to create xpath using attributes of different elements for ios app
body: <p>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)</p>
  
  <p><a href="https://i.stack.imgur.com/sCOaA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sCOaA.png" alt="enter image description here"></a></p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p><a href="https://i.stack.imgur.com/so2Ea.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/so2Ea.png" alt="enter image description here"></a></p>
  
  <p>so at the end i have an xpath something like:<code>(//XCUIElementTypeButton[@name="checkbox unselected"])[and text='The hydraulic system was operational']</code></p>