I am using Appium Server (1.3.4) and java_client 2.2.0. I can’t locate the contents of the a listview which is under framelayout (by xpath)
When I try to locate the frame with by ID, I can find it.
Goal : I want to get the list of all elements in ListView (Visible and Invisible). There might be an issue while getting the invisible elements by using (By ID) but I think hidden elements should be retrievable by using xpath.
Please see attached
When I use to find list view contents by ID, it only returns visible elements.
Platform : Android (Windows), Real device S3 4.4.2
When you say “invisible” I’m assuming you mean elements that are scrolled out of view, off the screen? From my adventures thus far Android does not support that at all, but iOS does.
So, for Android you will have to code your own functions that scroll the screen hunting for elements, and know when the scrolling has reached the end of the page. It is pretty annoying. I haven’t completed coding my functions to accomplish this successfully yet, but another user has shared Ruby examples of some functions here: https://discuss.appium.io/t/request-android-find-element-and-scroll-tips
In Android, xpath returns the visible elements on view not the elements which are not in view. So the developer has to implement their own functions and logic to locate, scroll and action on not in view elements.
hello all,
i want to click on element in a listview . i am using uiautomatorviewer and Appium v1.6.3 and java client 4.1.2.
driver.findElementByresourceId("//resourceid[@index=‘2’]").click();
but i am not able to click on element in gridview.
appium sever giving this error “contextId: ‘’ multiple: false”.
please help how could i solve this.
That doesn’t look like a valid resource id. uiautomatorviewer should show you what the resource id is.
Given that you are specifying an index, I suspect you are trying to get the 3rd element with the desired resource id. You should be using findElements, and using then choose the element from that list that matches the desired position.