Appium Send keys() function sending Chinese characters as part of English strings

半城伤御伤魂 提交于 2021-01-28 07:32:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!