Create the xpath with classname and text attribute...I think it should work!!!!!
It's working using list.
List list1=driver1.findElements(By.className("android.widget.Button")); for(WebElement value:list1){ System.out.println(value.getText()); if(value.getText().equals("Pair")){ value.click(); System.out.println("clicked"); } }