In the example below, Appium can correctly find elements by class, but when we want to manipulate data based on each content-desc element, we see an error. Why can't we get the attribute for content-desc? Any advice is appreciated.
List<WebElement> arrayOfProperties2 = driver.findElementsByClassName("android.view.View"); List<WebElement> propertyMarkerEle = new ArrayList<>(); System.out.println("Found arrayOfProperties2 total: "+ arrayOfProperties2.size()); for (WebElement property : arrayOfProperties2){ String contentDesc = property.getAttribute("content-desc"); if (contentDesc.contains("property")) propertyMarkerEle.add(property);
Error: Found arrayOfProperties2 total: 32
org.openqa.selenium.NoSuchElementException: the item cannot be located on the page using these search parameters. (WARNING: the server did not provide any stack information)
source share