Search code examples
androidrubyappiumappium-android

Elements are not visible after selecting items from dropdown in android app


There is a city field (drop down) in the address section, after clicking on it a pop up will open in which I can select the city after selecting city I'm not able to select any of the address elements.

def selecting state
      puts "Selecting State "
      puts  @utilities.is_element_present("id",get_selector(:address_1)) #returns true
      find_element(id:  get_selector(:province)).click #open dropdown
      sleep 1.5
      find_elements(id: "android:id/text1")[0].click . #select first state 
      sleep 2
      puts  @utilities.is_element_present("id",get_selector(:address_1))
#returns false   
    end

Ideally, address1 field should be true even after selecting the state.

enter image description here enter image description here


Solution

  • This issue has been there for years and it's up to Google to fix it.

    As a workaround you can create a list of object that your dropdown should contain and select item you want with 'down arrow' key. You can then verify what has been picked in textview field.