Appium 1.3.3以上,target version >16可以使用
java:
capabilities增加下面两项:
capabilities.setCapability("unicodeKeyboard", "True");
capabilities.setCapability("resetKeyboard", "True");
python:
desired_caps["unicodeKeyboard"] = "True"
desired_caps["resetKeyboard"] = "True"
Appium1.3.3之前,自行安装输入法(安装如D:\AppiumForWindows\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk)并设置为默认输入法就可以输入中文。
Appium1.3.3后,只是增加了支持自动切换到上述输入法:
capabilities.setCapability("unicodeKeyboard", "True");
using a specialized keyboard that allows the text to be passed as ASCII text between Appium and the application being tested.
配置为true,会自动使用输入法 Appium Android Input Manager for Unicode, 必须要有这个配置才能支持输入中文。
capabilities.setCapability("unicodeKeyboard", "True");
return the keyboard to its original state.without this capability,Unicode keyboard will remain enabled on the device after the tests are completed.
自定义是否还原输入法。
textfields[0].send_keys(u"李大宝")