Appium Send keys()函数将中文字符作为英文字符串的一部分发送 [英] Appium Send keys() function sending Chinese characters as part of English strings

查看:58
本文介绍了Appium Send keys()函数将中文字符作为英文字符串的一部分发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用appium send keys()函数在文本字段中发送名称时,除名称外,文本字段中还会出现一些随机的汉字.

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.

我们用于功能

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"

推荐答案

尝试添加这些功能,一个或另一个或两者,请尝试不同的组合.

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"); 

这篇关于Appium Send keys()函数将中文字符作为英文字符串的一部分发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆