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

I am a greenhorn Data Science student with interest in finding patterns in data. My language of choice is Python and I am starting to get my hands dirty with R.

I blog on Medium.com [1] and ConfusedCoders.com [2]. I share my code on Github.com [3].

  1.  https://medium.com/@nikkisharma536
  2. https://confusedcoders.com/author/nikita
  3. https://github.com/nikkisharma536

Leave a Reply

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