Android send_keys or type functions - Appium 1.3.3

I’m running into a strange issue when typing into multiple text fields. Typing in the first text field works fine but when I send_keys to the second field, it removes characters from the first text field before inserting text into the second one. Has anyone else experienced this?

example commands:
textfields[0].send_keys “ABCD”
textfields[1].send_keys “test”

  • I’ve also tried send_keys directly to the :id and :class objects for these fields too.

info: <-- POST /wd/hub/session/da8b37ba-c145-43a7-b29c-ee0c8d0e576f/element 200 11.808 ms - 88 {“status”:0,“value”:{“ELEMENT”:“29”},“sessionId”:“da8b37ba-c145-43a7-b29c-ee0c8d0e576f”}
info: --> POST /wd/hub/session/da8b37ba-c145-43a7-b29c-ee0c8d0e576f/element/29/value {“value”:[“test”]}
info: [debug] Pushing command to appium work queue: [“element:setText”,{“elementId”:“29”,“text”:“test”,“replace”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:setText”,“params”:{“elementId”:“29”,“text”:“test”,“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] Updating class “class com.android.uiautomator.core.UiDevice” to enable field “mUiAutomationBridge”
info: [debug] [BOOTSTRAP] [debug] Updating class “class com.android.uiautomator.core.UiAutomatorBridge” to enable field “mInteractionController”
info: [debug] [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.InteractionController
info: [debug] [BOOTSTRAP] [debug] Text remains after clearing, but it appears to be hint text.
info: [debug] [BOOTSTRAP] [debug] Text not cleared. Assuming remainder is hint text.
info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: test
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“da8b37ba-c145-43a7-b29c-ee0c8d0e576f”}

Ok… This looks to be fixed in the latest beta version so I guess it’s a known issue. Sorry for the duplicate post.

Yes, this is a known issue that should be fixed in the latest. If not, please open a bug on github.

Seems like not fixed in 1.3.4 or maybe i’m doing it wrong?

el = self.driver.find_element_by_class_name('android.widget.EditText')
el.send_keys('123')
tried:
el.set_text('123')

If it’s still broken on 1.3.4, open an issue on github.

Yes I am also facing this issue. Really frustated with this issue. Pls fix it

I am still facing the same issue with the latest Appium 1.3.4 SW.

When i execute the script the it tries to send the text through sendkeys to edit field but before that uniobject.cleartext() cmd runs and it doesn’t types anything in the field . It clears off everything continuosly instead typing in the field. sendkeys not able to send any text. Please find the below log for reference.

info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.TabHost[1]/android.widget.LinearLayout[2]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.LinearLayout, INSTANCE=10]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:{“ELEMENT”:“31”},“status”:0}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“31”},“sessionId”:“a6da2ca2-ce6d-42e6-89ef-1a0cd37f89d9”}
info: <-- POST /wd/hub/session/a6da2ca2-ce6d-42e6-89ef-1a0cd37f89d9/element 200 640.244 ms - 88 {“status”:0,“value”:{“ELEMENT”:“31”},“sessionId”:“a6da2ca2-ce6d-42e6-89ef-1a0cd37f89d9”}
info: --> POST /wd/hub/session/a6da2ca2-ce6d-42e6-89ef-1a0cd37f89d9/element/31/clear {“id”:“31”}
info: [debug] Pushing command to appium work queue: [“element:clear”,{“elementId”:“31”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:clear”,“params”:{“elementId”:“31”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: clear
info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}

You sure you upgraded?
I had that problem, and 1.3.4 fixed it…

This looks similar to your issue: https://github.com/appium/appium/issues/4263

Ya I upgraded and running through npm Appium 1.3.4 but same problem persists.

Which platform u r using ? Android
API level - 19 ??
Mac OS x 10.9.7 or Yosemite??

Please provide ur configuration if possible.

Meanwhile i will try to run once again if it really works for u than y not for me.

Thanks,
Nischal Sinha

OSX 10.9.5
Appium 1.3.4
Real Device - Samsung S5 - So it is API 20 (=> Android)

I will say this- when upgrading with npm, you need to do it from a specific folder, to verify it really updates your appium,
instead of simply creating a new appium application that no one uses or refers to (talking out of experience:) )

I m running Appium 1.3.4 server only through terminal

Check the log…

info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/nischalsinha/Documents/Cph_Moonshot/Moonshot_android/Application/Moonshot-debug.apk",“appPackage”:“com.android.moonshot”,“appActivity”:“com.android.moonshot.activity.SplashScreenActivity”,“platformVersion”:“4.4”,“platformName”:“Android”,“deviceName”:“4d007b574f344167”}}
info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
info: [debug] Using local app from desired caps:

Hello All,
I facing the same problem.It clicked on field but does not set the text.It’s very strange about this issue because it’s a very basic functionality which any tool support properly.

Configuration :
Appium Version - 1.3.4
Android Version - 4.4.2 (Using Samsung Note 2 and S4)

If any one know the alternate way of doing this, please let me know.

Regards,
Ashish

You could try selendroid mode. Uiautomator has a number of known issues related to entering text.

Calling a click on the element before calling send_keys worked for me.