I am learning appium (mobile automation) using python.
I have a scenario where I have a listView and I have to iterate through each item and then click back until all items are clicked.
I am using following code:
def test_selectingEveryOption(self):
availableOptions = self.driver.find_elements_by_xpath('//android.widget.ListView')
for options in availableOptions:
availableOptions[options].click()
self.driver.back()
availableOptions is the webElement that have the list. When I run above piece of code, I get TypeError: list indices must be integers or slices, not WebElement
Since availableOptions is webElement, how can I get its list items as integers and then iterate over them?