Slow text input

Hello!

I’m having issues with my test application. I’m testing Android app using java appium library. Server and emulator are running localy. Atm I’m using sendKeys() method to send key string to my android device and It is performing very slowly as you can see from the gif below the post.

The issue is that you can see from the gif is, that for whatever reason sendKeys is clicking on the screen, which additionally triggers my application’s DrawerLayout. I’ve noticed there are also other functionalities behind the method like deleting current text, making sure cursor is on first position, etc. It all adds up and causes delays.

I’ve tried using all sort of methods to send keyboard input to the devices, all produce same slow result input. I just want to simulate keyboard input, to whatever element is in focus. I don’t need additional functionality. ADB is not an option.

Any suggestions are welcome.

So, I have also seen this slow, and sometimes just odd, sendKeys() behavior on Android. I have not found a reliable work-around for this in Appium yet. One thing you didn’t mention is what version of Appium you are using. I am at 1.5.3 still.

I believe though that I read that the latest version of Appium 1.6, supports the newer UiAutomator v2, which is supposed to have better support for text based actions. Maybe someone who is already using Appium 1.6.x with UiAutomator 2 can comment on the difference if any they have seen.

I’m on 1.6.3 (npm). Java client library is 5.0.0 (also tried 4.1.2).

Are you utilizing the UiAutomator 2 driver? I believe it says you need to specify “automationName: uiautomator2” in your desired capabilities

Nope. I’ll try that out and let you know If there’s any improvements. Thanks.

Use setValue. Now available with android also

With UIAutomator2 automationName input is much faster, with sendKeys() method. There is still a tiny bit of a delay when the input actually starts, but it’s not that significant. Also, text input is instant and not letter by letter like.
There is only one problem tough. This kind of input does not take layout parameters into account. For example if I set android:digits="abc" to my layout’s EditText and then do driver.sendKeys("abc123"), it will not filter out 123, which is a bit unfortunate for now. Also if you set android:maxLength to View, it can crash your application, if you don’t handle index out of bounds exception.

It seems like setValue is still unimplemented.

@WildOrangutan you are wrong in latest 5.0.0-beta all is (beta actually working fine. at least for me.)

AndroidElement el;
el.replaceValue(“text_to_replace”);
el.sendKeys(“something_to_send”);
el.setValue(“something_to_set”);

I did fresh setup at home, you’re correct, sorry about that.