Appium python:appium1.6.3 中怎么使用 xpath 进行中文文字属性定位呀

jushual · 2017年01月01日 · 最后由 shishuaigang 回复于 2017年01月05日 · 1441 次阅读

例如我想定位图中的位置
使用如下两种代码 都提示找不到对应元素 但是非中文的就可以定位到

el1=self.driver.find_element_by_xpath('android.widget.TextView[@text="存储容量"]')
el1=self.driver.find_element_by_xpath('android.widget.TextView[contains(text,"存储容量")']

求解~~

共收到 3 条回复 时间 点赞

self.driver.find_element_by_xpath("//android.widget.TextView[contains(@text,'功能模块菜单')]")
我是这么定位的

#1 楼 @jiaoluo 请问你是 win 还是 mac 呀

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册