加入:
desired_caps['unicodeKeyboard'] = True

desired_caps['resetKeyboard'] = True

使用输入中文:

input_txt = driver.find_element_by_id('cn.com.taodaji:id/search_edit')
input_txt.send_keys(u'测试')

 上述代码改变了手机默认输入法为 resetKeyboard , 这时再输入字符或数字时,会出现输入不完全的问题,可以用以下方式切换输入法:

import os

#列出系统现在所安装的所有输入法 -a
cmd0 ='adb shell ime list -s'

#打印系统当前默认的输入法
cmd1 ='adb shell settings get secure default_input_method'

#切换输入法
cmd2 ='adb shell ime set com.sohu.inputmethod.sogouoem/.SogouIME'
cmd3 ='adb shell ime set io.appium.android.ime/.UnicodeIME'

def enable_sougou():
    print (cmd2)
    os.system(cmd2)

def enable_unicode():
    os.system(cmd3)

 

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-02-23
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2021-07-04
  • 2022-01-07
  • 2021-04-27
  • 2021-12-04
相关资源
相似解决方案