Retrieving hidden elements on Android

Hi All ,

I have a page in an app , where there are 100 elements with same resource id , but at a time only 6 of these are displayed , upon scrolling the next set of elements are displayed .

is there any way where i can get all of 100 elements at once ?

i tried using getelementsbyID, but it is retreving only 6 elements

Is there any particaular way of scrolling such that it displays exactly the next six elements ?

Since we are using devices with different screen size scrolling function might not be useful is guess

Please help

Android - no way to get elements outside screen.

1 Like

Thank you , but is there any way of utilizng the swipe or scroll functions effecively

because i dont want to miss out on an element in the list

if i do Scrool to visible or scroll to exact it is taking forver as the screen is moving up and down

or even by using any page source etc


(MobileElement) driver.findElement(MobileBy
                    .AndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView("
                            + "new UiSelector().text(\""+"SEARCH_TEXT_PUT_HERE"+"\"));"))

Thanks a lot bro, i am now interested in learning more of functions and operations using Android Ui automator where can i learn from ?

i jsut started working on Appium

Is there any function to scroll to the start before starting the excution as the function only does forward scroll

Also at the end of the all the element search it is throwinig an exception
any idea why ?

no idea. just catch the exception and see why.

Well i handled the exception part, but any thoughts on scrolling to start of screen ?

Hi Deva,
I am on same page, I want to get hidden element, do u got answer for this? if so can u post the answer please?

You have to scroll to the element first before you check if it is exist.

Have you try to scroll to it?