Xpath无法正常工作,我正在使用appium来定位xpath

时间:2019-09-27 02:54:21

标签: selenium xpath appium

应用本身建议的xpath不起作用

xpath : //[@accessibilityLabel=‘iconUncheck’ and (./preceding-sibling:: ./following-sibling::)[@id=‘Prod Test’]]

请帮助我构建xpath。 我要点击的元素 enter image description here

thee元素的

属性。 enter image description here

1 个答案:

答案 0 :(得分:0)

尝试下面的xpath

//*[@class='UIAImage' and ./following-sibling::*[@class='UIAView' and contains(text(),'Bone Marrow')]]

//*[@class='UIAImage' and ./following-sibling::*[contains(text(),'Bone Marrow')]]