# ListView Loading Issue

**URL:** <https://discuss.appium.io/t/listview-loading-issue/33857>\
**Category:** Issues/Bugs\
**Created:** [June 2, 2021, 11:59am UTC](https://discuss.appium.io/t/listview-loading-issue/33857 "2021-06-02T11:59:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![IamSaravana1994](https://discuss.appium.io/letter_avatar_proxy/v4/letter/i/e95f7d/32.png) [@IamSaravana1994](https://discuss.appium.io/u/IamSaravana1994)\
**Post date:** [June 2, 2021, 11:59am UTC](https://discuss.appium.io/t/listview-loading-issue/33857/1 "2021-06-02T11:59:51Z")

</div>

Hi Team,

We are trying to automate a Xamarin.Forms app in iOS through Appium.

Adding AutomationId alone isn`t enough to inspect ListView elements in the Appium.  
We have added following property **(AutomationProperties.IsInAccessibleTree=“False”)** as mentioned in the below Xamarin Forum link.

> **[Appium tests (iOS). Children of a XCUIElementTypeTable do not show, also the ...](https://forums.xamarin.com/discussion/104986/appium-tests-ios-children-of-a-xcuielementtypetable-do-not-show-also-the-table-has-elements)**
>
> I am automating my tests using appium. For this, I set the AutomationId of elements, and reference these in the tests. But now I have a structure like this:

Now, we are able to inspect ListView elements but we are facing another issue with respect to loading items in Listview.  
When we click refresh in Appium, depending on the data/rows in ListView Appium takes more time to load ListView.  
ListView is enabled with RetainElement as ListViewCachingStrategy and supported with Infinite Scrolling/Pagination.

On further analysis Appium seems to load all the data instead of trying to load only visible data in the Listview whereas in actual usage the infinite scroll triggers only after scrolling to the last item in the current avaialble data.

**For instance:** Let`s say only 5 rows are displayed in Listview. When we click refresh in Appium, it should try to load only 5 rows into it. Instead it tries to load all 20 rows of the first set.

Since infinite scroll is enabled,the next set/page/bucket of data should be fetched only when the last item has appeared or made visible by scrolling. As it is trying to load all the rows it automatically triggers the infinite scrolling to fetch the next set and it repeats until all the rows in the list are fetched.

This makes the UI unusable until all rows are loaded.

Would like to know if this is the expected behavior in Appium or any settings or work around in Appium/Xamarin could be suggested.

Thanks in Advance !!!..

Regards,  
Saravana Pandian M.

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [June 2, 2021, 12:55pm UTC](https://discuss.appium.io/t/listview-loading-issue/33857/2 "2021-06-02T12:55:02Z")

</div>

> [@IamSaravana1994](#):
>
> it should try to load only 5 rows into it. Instead it tries to load all 20 rows of the first set.

this is valid for Android with UIAutomator. But not for iOS. XCUITest (iOS native framework which uses Appium) shows ALL.  
You can see same using ‘Accessibility Inspector’ in xCode.

try reduce data. also you can limit element search with adding ‘visible == 1’ in predicate. [https://appium.io/docs/en/writing-running-appium/ios/ios-predicate/](https://appium.io/docs/en/writing-running-appium/ios/ios-predicate/)

---

<div class="post-metadata">

**Author:** ![IamSaravana1994](https://discuss.appium.io/letter_avatar_proxy/v4/letter/i/e95f7d/32.png) [@IamSaravana1994](https://discuss.appium.io/u/IamSaravana1994)\
**Post date:** [June 3, 2021, 6:37am UTC](https://discuss.appium.io/t/listview-loading-issue/33857/3 "2021-06-03T06:37:31Z")

</div>

Hi Aleksei,

Thanks for your quick response. We will check and update you on the suggested workaround.

We have one more query on ListView Swipe Action,

Since swipe action element called **MenuItem** is part of ListView, we have tried to add the same ListView fix **(AutomationProperties.IsInAccessibleTree=“False”)** here also. But, it actually not working as we couldn`t see the **AccessibilityIdentifier** anywhere in that attributes List in Appium tool. Whatever value we have given in **Text property** only reflects in all attributes such as Name, XPath, Value and Label in Appium.

**AutomationId** value not reflecting in Appium for this swipe action case.

**Code Snippet:**

\<ViewCell.ContextActions\>  
MenuItem x:Name=“menuItem” AutomationId="{Binding Name}" Text="{Binding Name}"  
\</ViewCell.ContextActions\>

Another problem we are facing in this is,

If ListView has 10 swipe action buttons, we can inspect only one random swipe button in Appium whereas I can inspect all 10 swipe buttons in Accessibility Inspector in XCode.

Is this also the iOS native behavior or do you have any workaround for this either from Xamarin or Appium side ?

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [June 3, 2021, 1:42pm UTC](https://discuss.appium.io/t/listview-loading-issue/33857/4 "2021-06-03T13:42:00Z")

</div>

1. About id - no idea. I am not iOS programmer. I used to work in native Swift code to add simple ids, a bit complicated accessible elements. Any harder work I am asking help of iOS developers. Do you see your ids ‘Accessibility Inspector’? If not - Appium will not see them also.
2. I do not use Appium GUI tool. So can’t comment. I like just grab ‘driver.getPageSource()’ in code on needed screen and read it.

---

<div class="post-metadata">

**Author:** ![IamSaravana1994](https://discuss.appium.io/letter_avatar_proxy/v4/letter/i/e95f7d/32.png) [@IamSaravana1994](https://discuss.appium.io/u/IamSaravana1994)\
**Post date:** [June 4, 2021, 2:42pm UTC](https://discuss.appium.io/t/listview-loading-issue/33857/5 "2021-06-04T14:42:34Z")

</div>

Okay Aleksei. Thanks for taking time to reply us.
