当前位置:网站首页>appium通过xpath获取对象文本中间显示空格异常问题

appium通过xpath获取对象文本中间显示空格异常问题

2022-06-21 22:24:00 春天的菠菜

appium,明明元素正确怎么就是找不到

//android.view.View[@content-desc="显示菜单 全部"]

通过循环将页面的全部类型对象打印输出到List

这样就能看出来

a = self.find_elements(*show_all_button2)
text = FindText(self.driver).find_text('//android.view.View')
L= []
for i in a:
text = i.get_attribute("contentDescription")
L.append(text)
print(L)

 打印结果:

[None,'显示菜单\n全部']

原网站

版权声明
本文为[春天的菠菜]所创,转载请带上原文链接,感谢
https://blog.csdn.net/legend818/article/details/125328096