This is a quick post to show how to select an item from an android dropdown/spinner in Appium-Python.
I have a dropdown with a given id – ‘list_country_name’, and i would like to select a value ‘Australia’ from the dropdown values.
I’m following the below steps :
- Get element for the country dropdown/spinner via ‘find_element_by_id’
- Trigger click action on dropdown
- Get the item for ‘Australia’ via ‘find_element_by_android_uiautomator’
- Trigger click action on the item found for ‘Australia’
Here is the code for the entire flow. I have also abstracted out the logic as a separate Python function that all my other test cases can reuse.
That’s all for this post. Hope it’s helpful. Cheers