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

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

问题描述

在使用appium的send keys()函数在text field中发送name时,除了name之外,一些随机的汉字出现在text field中.

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

最终结果是这样显示的汉字名"

推荐答案

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

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天全站免登陆