Text was sent by send_text() command is deleted after click on ‘android.widget.EditText’


I sent number into ‘android.widget.EditText’ field after that click to this field. But number is deleting after this.

number = self.driver.find_element_by_class_name('android.widget.EditText')

It appium:
Calling AppiumDriver.setValueImmediate() with args: [[“1111111111”],“5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3”,“64d03b56-8258-4ece-a5bf-53cd0296c00e”]
[WD Proxy] Matched ‘/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/value’ to command name ‘setValue’
[Protocol Converter] Added ‘value’ property [“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”] to ‘setValue’ request body
[WD Proxy] Proxying [POST /element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/value] to [POST http://localhost:8217/wd/hub/session/2eff3652-8d81-470c-a472-0d2876fe9c5f/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/value] with body: {“elementId”:“5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3”,“text”:“1111111111111”,“replace”:false,“unicodeKeyboard”:false,“value”:[“0”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”]}
[WD Proxy] Got response with status 200: {“sessionId”:“2eff3652-8d81-470c-a472-0d2876fe9c5f”,“value”:null}
[W3C (64d03b56)] Responding to client with driver.setValueImmediate() result: null
[HTTP] <-- POST /wd/hub/session/64d03b56-8258-4ece-a5bf-53cd0296c00e/appium/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/value 200 65 ms - 14
[HTTP] --> POST /wd/hub/session/64d03b56-8258-4ece-a5bf-53cd0296c00e/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/click
[HTTP] {“id”:“5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3”}
[W3C (64d03b56)] Calling AppiumDriver.click() with args: [“5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3”,“64d03b56-8258-4ece-a5bf-53cd0296c00e”]
[WD Proxy] Matched ‘/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/click’ to command name ‘click’
[WD Proxy] Proxying [POST /element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/click] to [POST http://localhost:8217/wd/hub/session/2eff3652-8d81-470c-a472-0d2876fe9c5f/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/click] with body: {“element”:“5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3”}
[WD Proxy] Got response with status 200: {“sessionId”:“2eff3652-8d81-470c-a472-0d2876fe9c5f”,“value”:null}
[W3C (64d03b56)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/64d03b56-8258-4ece-a5bf-53cd0296c00e/element/5c2c1dfe-8716-43fb-9a08-07ec2e8e34a3/click 200 88 ms - 14

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

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

  • Android 6.0
  • Appium 1.15.1
  • Windows

Thank you so much for your help.

try: click -> send text -> click.
and better use touch instead of click.

1 Like

Thank you for your advice. But it is still disappear.
And when i reproduce entering manualy - it is not delete. Also i had no this problem in previous appium version (something like 1.13)

I also tried to clear() field before using. And i changed send_keys to set_value. And tried to use ‘adb shell input text’, but it was not help

  1. you entering manually using keyboard. while during “send_keys” keyboard is closed is it?
  2. if you manually tap after “send_keys” it will be same?
  3. try to send text using keyboard instead element.
1 Like

Consider checking the particular input logic with your developers. It might be helpful to add more debug logging for the event where the content of the text field gets cleaned in the app code.

1 Like
  1. I try both of state (when closed and shown)
  2. If during debuging send_keys () and manually click on field - it delete too
  3. It has helped)
    I download GO keybord, and change test to:

field = self.driver.find_element_by_xpath(‘//android.widget.EditText[@content-desc=“Text”]’)
for num in range(9):

Thank you, very much :smile: