查找的是一个 textview,代码是这样的

两个函数中查找的是同一个 textview,先调用的 findInstallAndClick,成功,会调用 waitForStopAndClick,但是在此函数中查找,appium 就报错了。

错误信息:
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.FrameLayout[1]/androi
d.widget.LinearLayout[1]/android.widget.FrameLayout[2]/android.widget.LinearLayo
ut[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.wid
get.RelativeLayout[1]/android.widget.ListView[1]/android.widget.LinearLayout[1]/
android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.Line
arLayout[2]/android.widget.TextView[1] using XPATH with the contextId: multiple
: false
info: [debug] [UIAUTOMATOR STDOUT] java.lang.NullPointerException
info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.Accessibility
NodeInfoDumper.childNafCheck(AccessibilityNodeInfoDumper.java:200)
info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.Accessibility
NodeInfoDumper.nafCheck(AccessibilityNodeInfoDumper.java:180)
info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.Accessibility
NodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:104)

求助!


↙↙↙阅读原文可查看相关链接,并与作者交流