0
Я пишу тест автоматизации для Android-приложения.Как получить контент-desc в приложении Android с помощью appium
Когда я пытаюсь получить контент-desc для заголовка статьи. Я не могу это получить.
FYI У меня нет текста.
List<WebElement> arrayOfProperties2 = driver.findElementsByClassName("android.view.View");
for (WebElement property : arrayOfProperties2){
System.out.println("property" + property.getClass());
String contentDesc = property.getAttribute("name");
String contentDesc1 = property.getAttribute("className");
String contentDesc2 = property.getAttribute("resourceId");
System.out.println("contentDesc" + contentDesc);
System.out.println("contentDesc1" + contentDesc1);
System.out.println("contentDesc2" + contentDesc2);
}
Результат: -
contentDesc
contentDesc1android.view.View
contentDesc2
Я предполагаю, что GetAttribute ("контент-убывание") и GetAttribute ("contentDesc") Безразлично» (это не должно, но ...). Мне хотелось бы получить все атрибуты :) – kiedysktos
@kiedysktos Можете ли вы сказать мне, как это сделать? – karan
String contentDesc = property.getAttribute ("content-desc"); – kiedysktos