Appium 如何找到第一个匹配元素?

时间:2021-02-05 05:16:49

标签: xpath mobile automation appium

如何在“Appium”中使用 xpath 找到第一个匹配元素?

我正在尝试为匹配我的 xpath 的第一个元素编写 xpath

目前 xpath //android.view.View[contains(@text,'Sapiens A Brief History of Humankind Paperback English')] 匹配 2 个元素: enter image description here enter image description here

所以我将其修改为 (//android.view.View[contains(@text,'Sapiens A Brief History of Humankind Paperback English')])[0] 以获得第一场比赛: enter image description here

但现在它根本不突出任何元素:

enter image description here

我在这里做错了什么?

0 个答案:

没有答案