Alternative for send_keys methods in ruby_lib

I’m using sen_keys methods to enter value for EditText in Android and it looks so slow. Is there anyways to make it faster? I heard that Appium has setValue for java but i’m sure in ruby.

Thanks all.

You can use type. I’ve found that type was buggy on iOS (might not be the case in Android), so I’ve also explicitly set the value via:


Where field is the element you want to set the value on.

1 Like

On iOS, I recommend setValue via execute_script. For Android, there’s only send_keys unfortunately.

The type method being a bit buggy is a known issue and will be fixed at some point.

1 Like

Thanks @bootstraponline and @gavingmiller. So i will wait for the fix of that issues on Android.

I’m using .send_keys(“text”) and .clear and since 2 or 3 weeks, its’ completely buggy. For the exact same script than before, I see that theses functions edit the wrong field. I send the correct element but, for some reason, they loose their focus and goes to edit another filed in another page of my android app.
I don’t know if it’s related to the bug you’re talking about.

I’m declaring my driver like this :
@driver_appium =
@driver = @driver_appium.start_driver
And then :
field = @driver.find_element(:id, “com.myapp.demo:id/placementtaginterstitial”)

What I have to do to get the last Appium version ? What update should I do ?

I’m lost, send_keys and clear works fine (most of the time…) when I start Appium form the mac app.
But when I start Appium from the Terminal (with command line “appium”), I always have bug with theses functions.
But both are 1.3.1.
Why two different experience ?
Thanks !

What bug did you get? I used it a lot and didn’t get any issues

I’ve had similar issues. One thing I’m doing now is not using .clear unless .send_keys didn’t work after a couple of attempts. .clear can remove a character or two from a different field. It may have to do with two text widgets on the same line. I have the Android developer options set to show touches (second not the first) and I can see it trying to select all and the characters that are deleted are on that column. No idea if that is related. A work-around I’ve used it to change the order of elements that I fill out and verifying that the .text matches what I just sent in with send_keys.

I am seeing this exact behavior. The application (1.3.3) logs keystrokes (via send_keys) one at a time (slowly) through the keyboard. However, when I run appium (installed via npm) from the command line (1.3.4), the text shows in the text field immediately (no delay and not sent through the keyboard).

In this latter case, while it shows in the text field the UITextField itself does not seem to recognize that the data was entered as none of the delegate methods are being called.

I recommend adjusting the sendKeysStrategy desired capability. This will change what the server does when the Ruby bindings sends the send_keys request. Note this is iOS only. On Android, I’m not aware of any alternative sending methods supported in the appium server.

sendKeyStrategy - strategy to use to type test into a test field. Simulator default: oneByOne. Real device default: grouped |oneByOne, grouped or setValue|

Yes, this fixed the issue. Curious why the command line (npm-installed) version seems to default differently than the .app version, but nonetheless setting it in the capabilities section works just fine. – Thanks!