Append text to text field

I’m using Appium and Java in an Android emulator, and the sendKeys erases the text in the element and then sets the new text.

Is there a way to keep the old text and just append a new one after that?

Example:
//Element text is “abc”
element.sendKeys("123");

Expected result = “abc123”
Actual result = “123”

Note: This is necessary due to a test case in which the input field should display a warning when it has the character limit and user tries to type a new character in the end.

Can you do this manually in the app? Some apps are setup so that the text disappears when you click it.

Why not just:
element.sendKeys("abc123")
There isn’t anything in your test that requires prepopulation of the element.

Yes, the field limit is 100 characters, and if the user inputs the 101st, a warning should be displayed.

That’s actually the point of the test. The requirement is that the field has 100 characters, and when the 101st is typed, the warning should be displayed

Ok, then you might take a look at this:

I’m sorry that I’m not understanding this, could you explain it better? Specifically why you would need existing text when you could just send 101 chars…

You can use keyboard intead. Tap on input. And type using keyboard or http://appium.io/docs/en/commands/device/keys/press-keycode/