appium: iOS send_keys sometimes does not work

The problem

I have several tests written in Python running in a simulator that input a search term in a text field, they all use the same method: self.driver.find_element_by_name('Address or landmark').click() self.driver.find_element_by_name('Address or landmark').send_keys(search_term)

Sometimes it does not work and the appium server logs shows a 200 response for that request. Appium server log

I have tried all sendKeysStrategy and still fails. I also have tried clearing the text field, tapping on it before input of the search term. The element is present, visible and I can retrieve it with my selector. I have tried several simulator iOS versions and devices Keyboard is also visible:

image

Thank you!

Environment

  • Appium v1.6.4
  • macOS Sierra 10.12.4
  • Node.js v7.10.0
  • Mobile platform/version under test: iOS 10.3
  • Real device or emulator/simulator: Simulator iPhone 5s

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 33 (10 by maintainers)

Most upvoted comments

@dpgraham hey Dan, I created a repo with a simple script and I included our latest public version of our app, the script is really simple it tries to set the text on the textfield and breaks into debugger if it cant, tries 100 times, hopefully that would be enough to reproduce, Ive ran it on my machine and around the 67th time I can reproduce, let me know if you need more info. thanks! https://github.com/eduardoreynoso/iOSAppiumIssue8573/

I double checked with my devs the criteria to clear text on that field and unless you press the (x) button to clear, we never clear the text. I believe its a bug in appium, what else can we do to narrow it down?

Can you try calling get page source before you calling ‘find_element_by_name’ to confirm that the element with name Address or landmark is in the XML.