title: Should all elements have unique class name in a native Android application?
body: <p>I used UI automation viewer to get an xpath selector for class and Appium driver states (correctly) that:
  *** Capybara::Ambiguous Exception: Ambiguous match, found 4 elements matching visible xpath "//android.widget.Button"</p>
  
  <p>Elements have different <code>text</code> property, so I could identify by this property, however I imagine things would get complicated in case the app  has multiple languages available.</p>
  
  <p>The article below seems to hint that because elements can share class names, locating by class only is not recommended:
  <a href="https://seleniumbycharan.com/2016/08/07/finding-elements-using-locators-in-appium/" rel="nofollow noreferrer">https://seleniumbycharan.com/2016/08/07/finding-elements-using-locators-in-appium/</a></p>
  
  <p>One solution would be to form an array of these elements and simply refer to an index. 
  Another is to use the text property.
  I do not like either of these solutions. </p>
  
  <p>Should I recommend the developer to assign some IDs or just varied class names, or are identical class name chains common in native app dev and this is not an anti-pattern in any way?</p>