Here is the question. How can I count all the elements with the resource ID body_bubble on a scrollable view ? When I use the driver.findElements (By.id ("body_bubble")).size() method, it gets only the elements that are currently in view (visible on the screen).

How can I find all the elements? I know that I can use something like new UiScrollable(new UiSelector()).scrollIntoView, but I can't wrap my head around it.

Please help me out.

enter image description here

2 Answers 2


In modern applications to gain performance not all the content is loaded at once. Option I would suggest is.

Can you scroll to the bottom of the page in the start and then try to find the elements? That way you can be sure that all the elements were loaded.

  • It does not work. There still will be visible only those elements that are currently visible on the screen.
    – LexSav
    Commented Nov 27, 2019 at 8:27
  • To find all elements you can always use driver.findElements (By.id ("body_bubble")) This will give you a list of IWebElements to do whatever you want. Of-course check the locator first because if that is not correct then nothing will work anyways. Commented Nov 28, 2019 at 6:14
  • You don't understand. I'm already using this method and it returns only those elements that are currently on the screen (visible). Other elements that will appear only after scrolling up or down I'm not able to get with this method. And that is my question: how can I get them all (even those that are not visible on the screen right now, but will be if you scroll).
    – LexSav
    Commented Nov 29, 2019 at 7:42
  • driver.findElements will find anything that is present in DOM. Your issue is those elements not being present in DOM, so as per my original suggestion can you first scroll to the bottom of the page? This will make sure your elements are loaded and then you can do driver.findElements Commented Nov 29, 2019 at 8:23
  • As per my original reply, your suggestion did not work. It seems that you assume that if something works for Selenium, it will work for Appium also. In this case you are wrong.
    – LexSav
    Commented Nov 29, 2019 at 11:52

Scroll Android app screen by 1/3 or 1/4 of full size of screen and use find all element and check there any new changes in screen elements e.g bubble element ID. continue this as long as there is change in elements appear on scroll.

driver.findElements (By.id ("body_bubble")); store in Arraylist and check text, if all duplicate text appear means there is no new text appeared elements are fetched.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.