I am working on a framework and need to log in to the app, hence wanting to sendKeys to the email and password fields:
public void enterLoginEmail() {
WebElement email = driver.findElement(MobileBy.AccessibilityId(“emailAddress”));
email.isDisplayed();
email.click();
email.sendKeys("[email protected]");
}
But the behaviour is inconsistent - with the most common result being the correct text being typed, then somehow a right click and copy the field, then it deletes the field completely, and finally will paste the original text twice. So in the end the field looks:
[email protected]@email.com
I have tried putting capabilities:
capability.setCapability(“unicodeKeyboard”, false);
capability.setCapability(“resetKeyboard”, false);
I have tried hiding keyboard:
driver.hideKeyboard();
I have tried adding +"\n" after the email text:
email.sendKeys("[email protected]" + “\n”);
I have tried stopping predicative text.
None of the above has helped - would anyone have an idea??
Note: Using Java 1.8.0_201 on Intellij, UIAutomator2, and Android emulator