Issues: Send keys not works in android
Issues Description:
I have been stuck with this issue for a few days now.
I am executing a script which has to type some text in a text box present in the screen.
Whenever the sendKeys() command with value like 1234567 is executed, it enters 12456 in the screen or sometimes does not type anything in the text box. It behave random every time and not enter exact data which I expect.
Also I face issue with clear text it’s not working properly it takes more time to clear or some time it’s not clearing all data present in textbox.
Tapping on the textbox works perfectly fine.
Below are the configuration I used at the time of execution:
Appium version: 1.10.0 / 1.12.0
Android version: 8.0 / 7.1
Device: Google Pixel / Samsung Galaxy S8
Application Developed: Kony (Hybrid Application)
Below the ways I used to resolve this issue:
- JavaScript executor used to send value in textbox/texfield
driver.executeScript(“document.getElementById(’#numtext’).setAttribute(‘value’, 123)”);
- Sendkeys()
driver.FindElement(By.Class(“textbox”)).SendKeys(“euiwt8947”);
- setText()
object.setText(String.valueOf(e.Age()));
- PressKeyCode
((AndroidDriver) driver).pressKeyCode(AndroidKeyCode.KEYCODE_0);
((AndroidDriver) driver).pressKeyCode(AndroidKeyCode.KEYCODE_1);
- getKeyboard()
driver.getKeyboard().sendKeys(“1”);
driver.getKeyboard().sendKeys(“2”);
Please revert me back how can I resolve this issue.
Thanks,
Vishal