Вопрос

I have Appium with Android device and I simply need get all items from list on screen. If I try

val x = driver.findElement(By.tagName("list"))

it gives me RemoteWebElement but Im not able to get its items or cast it to List or something like that.

Any idea how to get list of items?

Это было полезно?

Решение

I solved this with:

val list = driver.findElement(By.tagName("list"))
val listItems = list.findElements(By.tagName("text"))

it gives me list of visible WebElements from list and I can navigate through them with simple:

listItems.get(5)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top