Here is what I came up with using xpath:
def find_element_by_name(text)
driver.find_element(:xpath, "//*[@content-desc='#{text}']|//*[@text='#{text}']")
end
I am trying to preserve the previous behavior, so this finds matching text or content description. I've also created my own methods, find_element_by_text and find_element_by_desc. My xpath is not the strongest, so I'm happy to take any suggestions for improvement.
scroll_to still doesn't work reliably. It works inside my app, but not on an Android Settings page. There have been a number of questions about getting scroll_to to work along with suggestions as to how. I'll post my solution in another thread for those interested. I apologize in advance to all of you who aren't using Ruby.