문제

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