How to select an item from dropdown/spinner in Appium-Python (Android)

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

Leave a Reply

Your email address will not be published. Required fields are marked *