I found the following problem when using appium to control Sina News app. Enter Chinese into the text box, which is garbled, but there is no such problem in other app.
the code is as follows
-sharp-*-coding:utf-8-*-
from selenium.webdriver.support.ui import WebDriverWait
from appium import webdriver
desired_caps = {}
desired_caps["platformName"] = "Android"
desired_caps["deviceName"] = "TGIRPJOBFUZ9IJSW"
desired_caps["platformVersion"] = "6.0"
desired_caps["appPackage"] = "com.sina.news"
desired_caps["appActivity"] = "com.sina.news.ui.MainActivity"
desired_caps["noReset"] = True
desired_caps["unicodeKeyboard"] = True
desired_caps["resetKeyboard"] = True
driver = webdriver.Remote("http://192.168.54.56:4723/wd/hub", desired_caps)
if WebDriverWait(driver,20).until(lambda x:x.find_element_by_xpath("//android.widget.TextView[@resource-id="com.sina.news:id/avl"]")):
driver.find_element_by_xpath("//android.widget.TextView[@resource-id="com.sina.news:id/avl"]").click()
driver.find_element_by_xpath("//android.widget.EditText[@resource-id="com.sina.news:id/ajg"]").send_keys("")
while driver.find_element_by_xpath("//android.widget.EditText[@resource-id="com.sina.news:id/ajg"]").text != "":
driver.find_element_by_xpath("//android.widget.EditText[@resource-id="com.sina.news:id/ajg"]").send_keys("")
driver.find_element_by_xpath("//android.widget.ListView[@resource-id="com.sina.news:id/avn"]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]").click()