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