Pergunta

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?

Foi útil?

Solução

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)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top