Domanda

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?

È stato utile?

Soluzione

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)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top