例如,我通过 xpath 查找这个元素:self.el.get_xpath("//android.widget.CheckedTextView[@text='成员管理']")
在 appium--server 输出结果:
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"1"}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"2ccceab6-d086-4394-a095-ab2e7d9efd0e"}
info:
info: --> POST /wd/hub/session/2ccceab6-d086-4394-a095-ab2e7d9efd0e/element {"using":"xpath","value":"//android.widget.TextView[@text='鑼冨畞瀹?]","sessionId":"2ccceab6-d086-4394-a095-ab2e7d9efd0e"}
info: [debug] Waiting up to 5000ms for condition
info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.widget.TextView[@text='鑼冨畞瀹?]","context":"","multiple":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='鑼冨畞瀹?]","context":"","multiple":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.TextView[@text='鑼冨畞瀹?] using XPATH with the contextId: multiple: false
都是 xpath 的位置,有中文就显示论码。
我的 pycharm 设置的是 utf-8。
我的代码开头也用 # coding=utf-8 说明。
因为怕后面出现问题,所以代码中的每个输出的地方,我还是 print(u"...") 表示了。
剩下疑问:
appium-server 的设置中有什么要设置中文的地方吗?
安卓手机端有什么需要设置中文的地方吗?