Hi,
Can
anybody guide me on how to work with Android Listview. I want to identify the total no of items/options
available in the listview.
As per the screenshot, my Listview has 8 options.
so I used the below code to print the total no of items/options
available in the listview.
List<WebElement> items=driver.findElements(By.xpath("ListView"));
System.out.println(items.size());
But it prints '0' as a response.
Kindly help me on this. Thanks in advance
Best Regards,
Aniket Gadre
“Programming can be fun, so can cryptography; however they should not be combined.”
--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks Aniket and Anil. Now I’m able to get the no of items in the list view but I’m facing one more issue in that
My Listview has 11 items, initially it shows only 7 items in the screen, we are able to see the remaining 4 items only when we scroll down the list,
So when we get the items count using size() method, it prints the response as ‘7’ instead of 11. Kindly let me know how to resolve this
Best Regards,
Aniket Gadre
“Programming can be fun, so can cryptography; however they should not be combined.”
--
I want to iterate through a list view in my project. Each cell is having a number of items in it like TextViews. For that i want to know the number of cells in the List view. I have tried the //ListView/LinearLayout. But it returns only one cell. Please help me to solve this.
In Android, elements in a ListView are not created until they're scrolled to. You'll need to scroll and periodically count the distinct new cells that appear. It's not easy to do, unfortunately.
--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.