Please help me : how can I print out text (Ex: abc123) base on resource-id: priority_icon
Thank All.
Please help me : how can I print out text (Ex: abc123) base on resource-id: priority_icon
Thank All.
Try to use Appium Desktop, and open the inspector, you can check different locators there. This is a locators problem, if you can´t, ask to your application dev team for add more identifiers.
@Liddel give a try:
// let's find parent Framelayout
List<WebElement> parentList = driver.findElements(MobileBy.xpath("//android.widget.ImageView[contains(resource-id,'priority_icon')]/../../.."));
for (WebElement parent : parentList) {
// if textView with text "abc123" has some id better find by id inside parent
System.out.println(parent.findElement(MobileBy.id("your_id")).getText());
// or when no id -> by Text classname. it is first in parent. Second is "in 5days"
System.out.println(parent.findElement(MobileBy.className("android.widget.TextView")).getText());
}
Thanks all so much. I will try to do.