问题
while using appium send keys()
function to send the name in text field,in addition to name some random chinese characters appear in the text field.
we used in capability
capabilities.setCapability("unicodeKeyboard", "true");
even thought we could not solve the error
public ProfilePage click_On_Edit_Profile_Icon(String Name, String Email,String Alt_Mobile )throws Exception {
Thread.sleep(5000);
driver.findElementByXPath("//android.widget.EditText[contains(@resource-id,'etFlat')"].click();
Thread.sleep(3000);
driver.findElementByXPath("//android.widget.EditText[contains(@resource-id,'etFlat')"].sendKeys(Keys.chord(Keys.CONTROL, "a", Keys.DELETE),Name);
Thread.sleep(3000);
}
end result is showing this way
"漢字name"
回答1:
Try adding these capabilities, one or the another or both, try different combinations.
capabilities.setCapability(“locale”, “en_US”);
capabilities.setCapability(“language”, “en”);
Also try removing your capability...
capabilities.setCapability("unicodeKeyboard", "true");
来源:https://stackoverflow.com/questions/57770838/appium-send-keys-function-sending-chinese-characters-as-part-of-english-string