I have my login screen in app now. Each time the app is launched in screen the mobile number is pre filled with the older text.
I just want to know I have tried: >
It is definitely not efficient, could be improved and there's probably a better way... But, using adb's shell input key event codes I simply called "dpad right" to move the cursor all the way to the right. Once there, send the key code "DEL" to start deleting all the way back... So... two for-loops. This was mainly used for short texts:
public void cleatTextFully(WebElement element) {
int stringLength = element.getText().length();
for (int i = 0; i < stringLength; i++) {
mDriver.sendKeyEvent(22); // "KEYCODE_DPAD_RIGHT"
}
for (int i = 0; i < stringLength; i++) {
mDriver.sendKeyEvent(67); // "KEYCODE_DEL"
}
}
mDriver is the AppiumDriver instance. Hope this helps some what.