SendKeys sending the text that was cleared


I have a text field which is already filled, when i use SendKeys to send some text on it, appium deletes successfully the filled text, but when it comes to sending the new one. Appium sends the deleted text instead of the one passed in parameters…
Here is a extract of the logs:

> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"9","text":"0a48b12781","replace":false}]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"9"},"status":0}
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"9","text":"0a48b12781","replace":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: setText
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Clearing text not successful. Attempting to clear by selecting all and deleting.
> info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: 06 10 74 73 910a48b12781
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98a24ddc-284f-435c-9255-f2bbdbeff8e8"}

As the logs says, the sendkeys has indeed a parameter (0a48b12781) but at some point, it sends 06 10 74 73 91 which is the cleared text…

Has anyone encountred the same issue before? Is there a workaround?

I am using appium on an application with the following configuration:

  • Android 4.3
  • Appium 1.3.7
  • Windows

Thank you so much for your help.


Have you found any solution to this problem?


If I remember correctly, upgrading appium version did the work for me. What version of appium are you using?

We are using 1.6.3 right now and I was having that exact problem from time to time.

I added .clear() before .SendKeys() and my problem is solved (I think. Again, it happens “from time to time”)

Thank you for your time :slight_smile:

Sure thing, I just pulled the repo I used for testing. You are right, it doesn’t happen all the time. On some forms in the app however, we had this problem recurrently. We tackled this issue by tapping on another cell after clearing the cell we wanted to send keys to. So, if we imagine a form containing two EditTexts, the scenario was:
–> Tap on cell A and clear it
–> Tap on cell B
–> SendKeys to cell A

We resolved the problem but we increased the tests execution time :frowning: