求助!appcrawler中xpath如何获取到兄弟节点

求助,在使用appcrawler过程中,登陆页面,我已阅读并同意用户协议前面有一个勾选框,请问如何才能选中这个勾选框呢?

  • dom文件如下,加粗部分是要选中的部分,是我已阅读并同意的哥哥节点
<android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,858][110,924]" displayed="true">**
                        <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[62,871][103,913]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.widget.TextView index="4" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我已阅读并同意" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[121,869][352,914]" displayed="true" />

yml文件中testcast内容如下

      testcase:
  name: "TesterHome AppCrawler"
  steps:
    - xpath:  "//*[@text='登录/注册']"
      action: click
    - xpath: "//*[@text='账号密码登录']"
      action: click
    - xpath: "//*[@text='我已阅读并同意']/..//*[contains(@class,'android.view.ViewGroup')][3]"
      action: click
      times: 2
    - xpath: "//*[@text='请输入手机号']"
      action: 15011489790
    - xpath: "//*[@text='请输入密码']"
      action: qaz123456

  • 日志内容如下
    2021-05-19 19:52:13 INFO [AutomationSuite.28.$anonfun$new$2] Step(null,null,null,//*[@text='账号密码登录'],click,null,0)

    2021-05-19 19:52:13 INFO [AutomationSuite.31.$anonfun$new$2] //*[@text='账号密码登录']

    2021-05-19 19:52:13 INFO [AutomationSuite.32.$anonfun$new$2] click

    2021-05-19 19:52:13 INFO [Crawler.996.doElementAction] current element = Steps.tag=TextView.depth=13.text=账号密码登录

    2021-05-19 19:52:13 INFO [Crawler.997.doElementAction] current index = 4

    2021-05-19 19:52:13 INFO [Crawler.998.doElementAction] current action = click

    2021-05-19 19:52:13 INFO [Crawler.999.doElementAction] current xpath = //*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]//*[@text="账号密码登录"]

    2021-05-19 19:52:13 INFO [Crawler.1000.doElementAction] current url = Steps

    2021-05-19 19:52:13 INFO [Crawler.1001.doElementAction] current tag path = hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.TextView

    2021-05-19 19:52:13 INFO [Crawler.1002.doElementAction] current file name = Steps.tag=TextView.depth=13.text=账号密码登录

    2021-05-19 19:52:13 INFO [AppCrawler$.59.saveReqHash] save reqHash to 4

    2021-05-19 19:52:13 INFO [AppCrawler$.92.saveReqImg] save reqImg 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.click.png to 4

    2021-05-19 19:52:13 INFO [AppCrawler$.76.saveReqDom] save reqDom to 4

    2021-05-19 19:52:13 INFO [Crawler.1071.doElementAction] need input click

    2021-05-19 19:52:13 INFO [AppiumClient.53.findElementByURI] find by uri element= Steps.tag=TextView.depth=13.text=账号密码登录

    2021-05-19 19:52:13 INFO [AppiumClient.245.findElementsByURI] findElementByAndroidUIAutomator new UiSelector().className("android.widget.TextView").text("账号密码登录")

    2021-05-19 19:52:13 INFO [AppiumClient.60.findElementByURI] find by xpath success

    2021-05-19 19:52:13 INFO [Crawler.1080.doElementAction] mark 20210518145849/3_Steps.tag=TextView.depth=26.text=登录+注册.clicked.png to 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.click.png

    2021-05-19 19:52:13 INFO [AppiumClient.141.mark] read from 20210518145849/3_Steps.tag=TextView.depth=26.text=登录+注册.clicked.png

    2021-05-19 19:52:13 INFO [AppiumClient.154.mark] write png 20210518145849/3_Steps.tag=TextView.depth=26.text=登录+注册.clicked.png

    2021-05-19 19:52:13 INFO [AppiumClient.161.mark] ImageIO.write newImageName 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.click.png

    2021-05-19 19:52:13 INFO [Crawler.1095.$anonfun$doElementAction$5] click element

    2021-05-19 19:52:13 INFO [AppiumClient.174.click] [[io.appium.java_client.android.AndroidDriver, Capabilities: {app=, appActivity=.MainActivity, appPackage=com.yeqin.enterpriseservice, appium=http://127.0.0.1:4723/wd/hub, autoGrantPermissions=true, automationName=uiautomator2, databaseEnabled=false, desired={platformName=android, appium=http://127.0.0.1:4723/wd/hub, app=, appActivity=.MainActivity, appPackage=com.yeqin.enterpriseservice, autoGrantPermissions=true, automationName=uiautomator2, deviceName=demo, dontStopAppOnReset=true, fullReset=false, noReset=false}, deviceApiLevel=29, deviceManufacturer=Xiaomi, deviceModel=MIX 2S, deviceName=bce6f93c, deviceScreenDensity=440, deviceScreenSize=1080x2160, deviceUDID=bce6f93c, dontStopAppOnReset=true, fullReset=false, javascriptEnabled=true, locationContextEnabled=false, networkConnectionEnabled=true, noReset=false, pixelRatio=2.75, platform=LINUX, platformName=Android, platformVersion=10, statBarHeight=76, takesScreenshot=true, viewportRect={left=0, top=76, width=1080, height=2040}, warnings={}, webStorageEnabled=false}] -> -android uiautomator: new UiSelector().className("android.widget.TextView").text("账号密码登录")]

    2021-05-19 19:52:14 INFO [Crawler.1126.doElementAction] mark image exist

    2021-05-19 19:52:14 INFO [Crawler.1130.doElementAction] sleep 500 for loading

    2021-05-19 19:52:15 INFO [Crawler.627.refreshPage] refresh page

    2021-05-19 19:52:15 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium

    2021-05-19 19:52:15 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format

    2021-05-19 19:52:15 INFO [Crawler.645.parsePageContext] appName =

    2021-05-19 19:52:15 INFO [Crawler.649.parsePageContext] url=MainActivity

    2021-05-19 19:52:15 INFO [Crawler.673.parsePageContext] currentContentHash=2871cc71accd81f73df256e927e51277 lastContentHash=ad52563f8c217c1c4d89d6527a2fe91b

    2021-05-19 19:52:15 INFO [Crawler.675.parsePageContext] ui change

    2021-05-19 19:52:15 INFO [Crawler.931.saveDom] save to 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.dom

    2021-05-19 19:52:15 INFO [Crawler.953.saveScreen] start screenshot

    2021-05-19 19:52:15 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again

    2021-05-19 19:52:16 INFO [Crawler.977.saveScreen] screenshot success

    2021-05-19 19:52:16 INFO [AppCrawler$.67.saveResHash] save resHash to 4

    2021-05-19 19:52:16 INFO [AppCrawler$.101.saveResImg] save resImg 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.clicked.png to 4

    2021-05-19 19:52:16 INFO [AppCrawler$.84.saveResDom] save resDom to 4

    **2021-05-19 19:52:16 INFO [AutomationSuite.28.$anonfun$new$2] Step(null,null,null,//*[@text='我已阅读并同意']/..//*[contains(@class,'android.view.ViewGroup')][3],click,null,2)**

    2021-05-19 19:52:16 INFO [AutomationSuite.31.$anonfun$new$2] //*[@text='我已阅读并同意']/..//*[contains(@class,'android.view.ViewGroup')][3]

    2021-05-19 19:52:16 INFO [AutomationSuite.32.$anonfun$new$2] click

    2021-05-19 19:52:16 INFO [Crawler.996.doElementAction] current element = Steps.tag=android.view.ViewGroup.depth=12

    2021-05-19 19:52:16 INFO [Crawler.997.doElementAction] current index = 5

    2021-05-19 19:52:16 INFO [Crawler.998.doElementAction] current action = click

    2021-05-19 19:52:16 INFO [Crawler.999.doElementAction] current xpath = //*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]

    2021-05-19 19:52:16 INFO [Crawler.1000.doElementAction] current url = Steps

    2021-05-19 19:52:16 INFO [Crawler.1001.doElementAction] current tag path = hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup

    2021-05-19 19:52:16 INFO [Crawler.1002.doElementAction] current file name = Steps.tag=android.view.ViewGroup.depth=12

    2021-05-19 19:52:16 INFO [AppCrawler$.59.saveReqHash] save reqHash to 5

    2021-05-19 19:52:16 INFO [AppCrawler$.92.saveReqImg] save reqImg 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.click.png to 5

    2021-05-19 19:52:16 INFO [AppCrawler$.76.saveReqDom] save reqDom to 5

    2021-05-19 19:52:16 INFO [Crawler.1071.doElementAction] need input click

    2021-05-19 19:52:16 INFO [AppiumClient.53.findElementByURI] find by uri element= Steps.tag=android.view.ViewGroup.depth=12

    2021-05-19 19:52:16 INFO [AppiumClient.245.findElementsByURI] findElementByAndroidUIAutomator new UiSelector().className("android.view.ViewGroup")

    2021-05-19 19:52:16 INFO [AppiumClient.60.findElementByURI] find by xpath success

    2021-05-19 19:52:16 INFO [Crawler.1080.doElementAction] mark 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.clicked.png to 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.click.png

    2021-05-19 19:52:16 INFO [AppiumClient.141.mark] read from 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.clicked.png

    2021-05-19 19:52:16 INFO [AppiumClient.154.mark] write png 20210518145849/4_Steps.tag=TextView.depth=13.text=账号密码登录.clicked.png

    2021-05-19 19:52:16 INFO [AppiumClient.161.mark] ImageIO.write newImageName 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.click.png

    2021-05-19 19:52:16 INFO [Crawler.1095.$anonfun$doElementAction$5] click element

    2021-05-19 19:52:16 INFO [AppiumClient.174.click] [[io.appium.java_client.android.AndroidDriver, Capabilities: {app=, appActivity=.MainActivity, appPackage=com.yeqin.enterpriseservice, appium=http://127.0.0.1:4723/wd/hub, autoGrantPermissions=true, automationName=uiautomator2, databaseEnabled=false, desired={platformName=android, appium=http://127.0.0.1:4723/wd/hub, app=, appActivity=.MainActivity, appPackage=com.yeqin.enterpriseservice, autoGrantPermissions=true, automationName=uiautomator2, deviceName=demo, dontStopAppOnReset=true, fullReset=false, noReset=false}, deviceApiLevel=29, deviceManufacturer=Xiaomi, deviceModel=MIX 2S, deviceName=bce6f93c, deviceScreenDensity=440, deviceScreenSize=1080x2160, deviceUDID=bce6f93c, dontStopAppOnReset=true, fullReset=false, javascriptEnabled=true, locationContextEnabled=false, networkConnectionEnabled=true, noReset=false, pixelRatio=2.75, platform=LINUX, platformName=Android, platformVersion=10, statBarHeight=76, takesScreenshot=true, viewportRect={left=0, top=76, width=1080, height=2040}, warnings={}, webStorageEnabled=false}] -> -android uiautomator: new UiSelector().className("android.view.ViewGroup")]

    2021-05-19 19:52:16 INFO [Crawler.1126.doElementAction] mark image exist

    2021-05-19 19:52:16 INFO [Crawler.1130.doElementAction] sleep 500 for loading

    2021-05-19 19:52:17 INFO [Crawler.627.refreshPage] refresh page

    2021-05-19 19:52:17 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium

    2021-05-19 19:52:17 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format

    2021-05-19 19:52:17 INFO [Crawler.645.parsePageContext] appName =

    2021-05-19 19:52:18 INFO [Crawler.649.parsePageContext] url=MainActivity

    2021-05-19 19:52:18 INFO [Crawler.673.parsePageContext] currentContentHash=90b251e586f35d22a93b63feb6c99a4e lastContentHash=2871cc71accd81f73df256e927e51277

    2021-05-19 19:52:18 INFO [Crawler.675.parsePageContext] ui change

    2021-05-19 19:52:18 INFO [Crawler.931.saveDom] save to 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.dom

    2021-05-19 19:52:18 INFO [Crawler.953.saveScreen] start screenshot

    2021-05-19 19:52:18 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again

    2021-05-19 19:52:18 INFO [Crawler.977.saveScreen] screenshot success

    2021-05-19 19:52:18 INFO [AppCrawler$.67.saveResHash] save resHash to 5

    2021-05-19 19:52:18 INFO [AppCrawler$.101.saveResImg] save resImg 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.clicked.png to 5

    2021-05-19 19:52:18 INFO [AppCrawler$.84.saveResDom] save resDom to 5

    2021-05-19 19:52:18 INFO [AutomationSuite.28.$anonfun$new$2] Step(null,null,null,//*[@text='请输入手机号'],15000000000,null,0)

    2021-05-19 19:52:18 INFO [AutomationSuite.31.$anonfun$new$2] //*[@text='请输入手机号']

    2021-05-19 19:52:18 INFO [AutomationSuite.32.$anonfun$new$2] 15000000000

    2021-05-19 19:52:18 INFO [Crawler.996.doElementAction] current element = Steps.tag=EditText.depth=13.text=请输入手机号

    2021-05-19 19:52:18 INFO [Crawler.997.doElementAction] current index = 6

    2021-05-19 19:52:18 INFO [Crawler.998.doElementAction] current action = 15000000000

    2021-05-19 19:52:18 INFO [Crawler.999.doElementAction] current xpath = //*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]//*[@text="请输入手机号"]

    2021-05-19 19:52:18 INFO [Crawler.1000.doElementAction] current url = Steps

    2021-05-19 19:52:18 INFO [Crawler.1001.doElementAction] current tag path = hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.EditText

    2021-05-19 19:52:18 INFO [Crawler.1002.doElementAction] current file name = Steps.tag=EditText.depth=13.text=请输入手机号

    2021-05-19 19:52:18 INFO [AppCrawler$.59.saveReqHash] save reqHash to 6

    2021-05-19 19:52:18 INFO [AppCrawler$.92.saveReqImg] save reqImg 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.click.png to 6

    2021-05-19 19:52:18 INFO [AppCrawler$.76.saveReqDom] save reqDom to 6

    2021-05-19 19:52:18 INFO [Crawler.1071.doElementAction] need input 15000000000

    2021-05-19 19:52:18 INFO [AppiumClient.53.findElementByURI] find by uri element= Steps.tag=EditText.depth=13.text=请输入手机号

    2021-05-19 19:52:18 INFO [AppiumClient.245.findElementsByURI] findElementByAndroidUIAutomator new UiSelector().className("android.widget.EditText").text("请输入手机号")

    2021-05-19 19:52:18 INFO [AppiumClient.60.findElementByURI] find by xpath success

    2021-05-19 19:52:19 INFO [Crawler.1080.doElementAction] mark 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.clicked.png to 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.click.png

    2021-05-19 19:52:19 INFO [AppiumClient.141.mark] read from 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.clicked.png

    2021-05-19 19:52:19 INFO [AppiumClient.154.mark] write png 20210518145849/5_Steps.tag=android.view.ViewGroup.depth=12.clicked.png

    2021-05-19 19:52:19 INFO [AppiumClient.161.mark] ImageIO.write newImageName 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.click.png

    2021-05-19 19:52:19 INFO [Crawler.1106.$anonfun$doElementAction$5] input 15000000000

    2021-05-19 19:52:20 INFO [Crawler.1126.doElementAction] mark image exist

    2021-05-19 19:52:20 INFO [Crawler.1130.doElementAction] sleep 500 for loading

    2021-05-19 19:52:20 INFO [Crawler.627.refreshPage] refresh page

    2021-05-19 19:52:20 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium

    2021-05-19 19:52:20 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format

    2021-05-19 19:52:20 INFO [Crawler.645.parsePageContext] appName =

    2021-05-19 19:52:21 INFO [Crawler.649.parsePageContext] url=MainActivity

    2021-05-19 19:52:21 INFO [Crawler.673.parsePageContext] currentContentHash=3bd85d104bcff2d855995dcaf4a5add6 lastContentHash=90b251e586f35d22a93b63feb6c99a4e

    2021-05-19 19:52:21 INFO [Crawler.675.parsePageContext] ui change

    2021-05-19 19:52:21 INFO [Crawler.931.saveDom] save to 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.dom

    2021-05-19 19:52:21 INFO [Crawler.953.saveScreen] start screenshot

    2021-05-19 19:52:21 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again

    2021-05-19 19:52:21 INFO [Crawler.977.saveScreen] screenshot success

    2021-05-19 19:52:21 INFO [AppCrawler$.67.saveResHash] save resHash to 6

    2021-05-19 19:52:21 INFO [AppCrawler$.101.saveResImg] save resImg 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.clicked.png to 6

    2021-05-19 19:52:21 INFO [AppCrawler$.84.saveResDom] save resDom to 6

    2021-05-19 19:52:21 INFO [AutomationSuite.28.$anonfun$new$2] Step(null,null,null,//*[@text='请输入密码'],qaz123456,null,0)

    2021-05-19 19:52:21 INFO [AutomationSuite.31.$anonfun$new$2] //*[@text='请输入密码']

    2021-05-19 19:52:21 INFO [AutomationSuite.32.$anonfun$new$2] qaz123456

    2021-05-19 19:52:21 INFO [Crawler.996.doElementAction] current element = Steps.tag=EditText.depth=13.text=请输入密码

    2021-05-19 19:52:21 INFO [Crawler.997.doElementAction] current index = 7

    2021-05-19 19:52:21 INFO [Crawler.998.doElementAction] current action = qaz123456

    2021-05-19 19:52:21 INFO [Crawler.999.doElementAction] current xpath = //*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]//*[@text="请输入密码"]

    2021-05-19 19:52:21 INFO [Crawler.1000.doElementAction] current url = Steps

    2021-05-19 19:52:21 INFO [Crawler.1001.doElementAction] current tag path = hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.EditText

    2021-05-19 19:52:21 INFO [Crawler.1002.doElementAction] current file name = Steps.tag=EditText.depth=13.text=请输入密码

    2021-05-19 19:52:21 INFO [AppCrawler$.59.saveReqHash] save reqHash to 7

    2021-05-19 19:52:21 INFO [AppCrawler$.92.saveReqImg] save reqImg 20210518145849/7_Steps.tag=EditText.depth=13.text=请输入密码.click.png to 7

    2021-05-19 19:52:21 INFO [AppCrawler$.76.saveReqDom] save reqDom to 7

    2021-05-19 19:52:21 INFO [Crawler.1071.doElementAction] need input qaz123456

    2021-05-19 19:52:21 INFO [AppiumClient.53.findElementByURI] find by uri element= Steps.tag=EditText.depth=13.text=请输入密码

    2021-05-19 19:52:21 INFO [AppiumClient.245.findElementsByURI] findElementByAndroidUIAutomator new UiSelector().className("android.widget.EditText").text("请输入密码")

    2021-05-19 19:52:21 INFO [AppiumClient.60.findElementByURI] find by xpath success

    2021-05-19 19:52:22 INFO [Crawler.1080.doElementAction] mark 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.clicked.png to 20210518145849/7_Steps.tag=EditText.depth=13.text=请输入密码.click.png

    2021-05-19 19:52:22 INFO [AppiumClient.141.mark] read from 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.clicked.png

    2021-05-19 19:52:22 INFO [AppiumClient.154.mark] write png 20210518145849/6_Steps.tag=EditText.depth=13.text=请输入手机号.clicked.png

    2021-05-19 19:52:22 INFO [AppiumClient.161.mark] ImageIO.write newImageName 20210518145849/7_Steps.tag=EditText.depth=13.text=请输入密码.click.png

    2021-05-19 19:52:22 INFO [Crawler.1106.$anonfun$doElementAction$5] input qaz123456

    2021-05-19 19:52:23 INFO [Crawler.1126.doElementAction] mark image exist

    2021-05-19 19:52:23 INFO [Crawler.1130.doElementAction] sleep 500 for loading

    2021-05-19 19:52:24 INFO [Crawler.627.refreshPage] refresh page

    2021-05-19 19:52:24 INFO [AppiumClient.102.getPageSourceWithRetry] start to get page source from appium

    2021-05-19 19:52:24 INFO [AppiumClient.117.$anonfun$getPageSourceWithRetry$1] xml format

    2021-05-19 19:52:24 INFO [Crawler.645.parsePageContext] appName =

    2021-05-19 19:52:24 INFO [Crawler.649.parsePageContext] url=MainActivity

    2021-05-19 19:52:24 INFO [Crawler.673.parsePageContext] currentContentHash=4ee6fd5e345a60589fd6554c8e6ef152 lastContentHash=3bd85d104bcff2d855995dcaf4a5add6

    2021-05-19 19:52:24 INFO [Crawler.675.parsePageContext] ui change

    2021-05-19 19:52:24 INFO [Crawler.931.saveDom] save to 20210518145849/7_Steps.tag=EditText.depth=13.text=请输入密码.dom

    2021-05-19 19:52:24 INFO [Crawler.953.saveScreen] start screenshot

    2021-05-19 19:52:24 INFO [Crawler.956.$anonfun$saveScreen$2] ui change screenshot again

    çç2021-05-19 19:52:25 INFO [Crawler.977.saveScreen] screenshot success

    2021-05-19 19:52:25 INFO [AppCrawler$.67.saveResHash] save resHash to 7

    2021-05-19 19:52:25 INFO [AppCrawler$.101.saveResImg] save resImg 20210518145849/7_Steps.tag=EditText.depth=13.text=请输入密码.clicked.png to 7

    2021-05-19 19:52:25 INFO [AppCrawler$.84.saveResDom] save resDom to 7

    2021-05-19 19:52:25 INFO [AutomationSuite.66.$anonfun$new$1] finish run steps

用appium尝试过下面的路径是可以找到该复选框,但在appcrawler的xpath里面却找不到

    # - xpath: "//*[@text='我已阅读并同意']/preceding-sibling::android.view.ViewGroup[1]"
    # - xpath: "//android.view.ViewGroup[@bounds='[55,858][110,924]']"
    # - xpath: "//*[@text='我已阅读并同意']//preceding-sibling::android.view.ViewGroup[1]"
    # - xpath: //*[@text="我已阅读并同意"]/../android.view.ViewGroup[3]
    # - xpath: "//*[contains(@class,'android.view.ViewGroup') and @bounds='[55,858][110,924]']"
    # - xpath: "//*[@text='我已阅读并同意']//..//android.view.ViewGroup[3]"
    # - xpath: "//*[@text='我已阅读并同意']//../*[contains(@class,'android.view.ViewGroup')][3]"
    # - xpath: "//*[@text='我已阅读并同意']/parent::*/android.view.ViewGroup[3]"
    # - xpath: "//android.widget.ImageView[@bounds='[62,871][103,913]']"
    # - xpath: "//*[@text='我已阅读并同意']//parent::*//*[@class='android.view.ViewGroup'][3]"

直接用 //*[contains(@text, '我已阅读')] 不就可以找到了?

不行的,点我已阅读,选不上前面的勾选框,勾选框是我已阅读的上一个哥哥节点

为什么中间有一个特殊的`符号,是你自己贴错了,还是说配置文件压根就不对。appcrawler支持完整的xpath,xpath写对是比较关键的。

另外,appcrawler在结果目录中保留了当时的dom结构,是个xml文件,你可以用xpath测试下是不是可以定位的到。

另外因为看不到你完整的dom结构,我也不敢说你的xpath对不对。你最好贴下完整的xml。

ps:貌似收到你老大的特殊叮嘱了,说让我帮忙看看,我只好遵命过来看看了。。。

xpath前面的‘是在粘贴进来加粗了加上的,在testcase里面是没有的,我试了在结果目录中保留的dom结构,通过xpath测试可以定位到,请大佬再帮忙看下,感激不尽

原始的完整的dom文件如下(新用户没办法上传附件只能粘了)

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy index="0" class="hierarchy" rotation="0" width="1080" height="2116">
  <android.widget.FrameLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
    <android.widget.LinearLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.LinearLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
      <android.widget.FrameLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
        <android.widget.LinearLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.LinearLayout" text="" resource-id="com.yeqin.enterpriseservice:id/action_bar_root" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
          <android.widget.FrameLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.FrameLayout" text="" resource-id="android:id/content" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
            <android.widget.FrameLayout index="0" package="com.yeqin.enterpriseservice" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
              <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                  <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                    <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                      <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                        <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                          <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                            <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                              <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                  <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                    <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                      <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                        <android.widget.ScrollView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ScrollView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                          <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true">
                                            <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,594]" displayed="true">
                                              <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,594]" displayed="true" />
                                              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,594]" displayed="true">
                                                <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[871,55][937,176]" displayed="true">
                                                  <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[871,83][937,149]" displayed="true" />
                                                </android.view.ViewGroup>
                                                <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[976,55][1042,176]" displayed="true">
                                                  <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[976,83][1042,149]" displayed="true" />
                                                </android.view.ViewGroup>
                                                <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,250][226,420]" displayed="true">
                                                  <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,250][226,420]" displayed="true" />
                                                </android.view.ViewGroup>
                                                <android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[259,296][570,374]" displayed="true">
                                                  <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="登录/注册" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[259,296][515,374]" displayed="true" />
                                                  <android.widget.ImageView index="1" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[526,313][570,357]" displayed="true" />
                                                </android.view.ViewGroup>
                                              </android.view.ViewGroup>
                                            </android.view.ViewGroup>
                                            <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[33,495][1047,693]" displayed="true">
                                              <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[224,519][368,669]" displayed="true">
                                                <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="0" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[276,519][317,607]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我的积分" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[224,621][368,669]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[749,519][857,669]" displayed="true">
                                                <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="0" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[783,519][824,607]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="优惠券" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[749,621][857,669]" displayed="true" />
                                              </android.view.ViewGroup>
                                            </android.view.ViewGroup>
                                            <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[33,726][1047,1069]" displayed="true">
                                              <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[33,726][1047,835]" displayed="true">
                                                <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="订单" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[66,776][154,835]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="全部订单" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[825,779][981,831]" displayed="true" />
                                                <android.widget.ImageView index="2" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[981,789][1014,822]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[44,879][242,1014]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[103,879][183,958]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="待付款" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[94,970][193,1014]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[242,879][441,1014]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[301,879][380,958]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="待服务" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[292,970][391,1014]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[441,879][639,1014]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[500,879][580,958]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="服务中" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[491,970][590,1014]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="4" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[639,879][838,1014]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[698,879][777,958]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="待评价" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[689,970][788,1014]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="5" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[838,879][1036,1014]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[897,879][977,958]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我的退款" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[871,970][1003,1014]" displayed="true" />
                                              </android.view.ViewGroup>
                                            </android.view.ViewGroup>
                                            <android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[33,1102][1047,1634]" displayed="true">
                                              <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="常用功能" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[66,1149][242,1208]" displayed="true" />
                                              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[41,1255][241,1391]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[101,1255][181,1335]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="领券中心" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[75,1346][207,1391]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[241,1255][440,1391]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[301,1255][380,1335]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="收藏商品" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[275,1346][407,1391]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[440,1255][640,1391]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[500,1255][580,1335]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我的关注" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[474,1346][606,1391]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="4" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[640,1255][839,1391]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[700,1255][779,1335]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="联系客服" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[674,1346][806,1391]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="5" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[839,1255][1039,1391]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[899,1255][978,1335]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="意见反馈" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[873,1346][1005,1391]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="6" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[41,1444][241,1579]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[101,1444][181,1523]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="常用联系人" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[58,1535][223,1579]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="7" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[241,1444][440,1579]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[301,1444][380,1523]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="常用申请人" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[258,1535][423,1579]" displayed="true" />
                                              </android.view.ViewGroup>
                                              <android.view.ViewGroup index="8" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[440,1444][640,1579]" displayed="true">
                                                <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[500,1444][580,1523]" displayed="true" />
                                                <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="开发配置" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[474,1535][606,1579]" displayed="true" />
                                              </android.view.ViewGroup>
                                            </android.view.ViewGroup>
                                            <android.widget.TextView index="4" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="©2021北京业勤企服科技有限公司" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[293,1871][787,1921]" displayed="true" />
                                          </android.view.ViewGroup>
                                        </android.widget.ScrollView>
                                      </android.view.ViewGroup>
                                    </android.view.ViewGroup>
                                  </android.view.ViewGroup>
                                </android.view.ViewGroup>
                                <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,1981]" displayed="true" />
                              </android.view.ViewGroup>
                              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,1981][1080,2116]" displayed="true">
                                <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,1982][1080,2116]" displayed="true">
                                  <android.widget.Button index="0" package="com.yeqin.enterpriseservice" class="android.widget.Button" text="" content-desc="首页, tab, 1 of 4" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,1982][270,2116]" displayed="true">
                                    <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,1982][270,2064]" displayed="true">
                                      <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[108,1996][163,2051]" displayed="true" />
                                    </android.view.ViewGroup>
                                    <android.widget.TextView index="2" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="首页" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[107,2064][163,2102]" displayed="true" />
                                  </android.widget.Button>
                                  <android.widget.Button index="1" package="com.yeqin.enterpriseservice" class="android.widget.Button" text="" content-desc="分类, tab, 2 of 4" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[270,1982][540,2116]" displayed="true">
                                    <android.widget.ImageView index="1" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[378,1996][433,2051]" displayed="true" />
                                    <android.widget.TextView index="2" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="分类" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[377,2064][433,2102]" displayed="true" />
                                  </android.widget.Button>
                                  <android.widget.Button index="2" package="com.yeqin.enterpriseservice" class="android.widget.Button" text="" content-desc="购物车, tab, 3 of 4" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[540,1982][810,2116]" displayed="true">
                                    <android.widget.ImageView index="1" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[648,1996][703,2051]" displayed="true" />
                                    <android.widget.TextView index="2" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="购物车" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[633,2064][717,2102]" displayed="true" />
                                  </android.widget.Button>
                                  <android.widget.Button index="3" package="com.yeqin.enterpriseservice" class="android.widget.Button" text="" content-desc="我的, tab, 4 of 4" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="true" bounds="[810,1982][1080,2116]" displayed="true">
                                    <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[810,1982][1080,2064]" displayed="true">
                                      <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[918,1996][973,2051]" displayed="true" />
                                    </android.view.ViewGroup>
                                    <android.widget.TextView index="2" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我的" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[917,2064][973,2102]" displayed="true" />
                                  </android.widget.Button>
                                </android.view.ViewGroup>
                              </android.view.ViewGroup>
                            </android.view.ViewGroup>
                          </android.view.ViewGroup>
                        </android.view.ViewGroup>
                      </android.view.ViewGroup>
                    </android.view.ViewGroup>
                  </android.view.ViewGroup>
                </android.view.ViewGroup>
              </android.view.ViewGroup>
              <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                  <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2116]" displayed="true">
                    <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,83][146,204]" displayed="true">
                      <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[44,116][102,171]" displayed="true" />
                    </android.view.ViewGroup>
                    <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,154][1025,2116]" displayed="true">
                      <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[353,154][727,374]" displayed="true" />
                      <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,462][1025,600]" displayed="true">
                        <android.widget.EditText index="0" package="com.yeqin.enterpriseservice" class="android.widget.EditText" text="请输入手机号" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="true" password="false" scrollable="false" selected="false" bounds="[55,492][1025,568]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,644][1025,781]" displayed="true">
                        <android.widget.EditText index="0" package="com.yeqin.enterpriseservice" class="android.widget.EditText" text="请输入密码" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="true" password="true" scrollable="false" selected="false" bounds="[55,674][606,750]" displayed="true" />
                        <android.view.ViewGroup index="1" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[606,685][755,740]" displayed="true">
                          <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[700,685][755,740]" displayed="true" />
                        </android.view.ViewGroup>
                        <android.view.ViewGroup index="2" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[804,683][1025,742]" displayed="true">
                          <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="忘记密码" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[849,683][1025,742]" displayed="true" />
                        </android.view.ViewGroup>
                      </android.view.ViewGroup>
                      <android.view.ViewGroup index="3" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,858][110,924]" displayed="true">
                        <android.widget.ImageView index="0" package="com.yeqin.enterpriseservice" class="android.widget.ImageView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[62,871][103,913]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.widget.TextView index="4" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="我已阅读并同意" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[121,869][352,914]" displayed="true" />
                      <android.view.ViewGroup index="5" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[352,869][534,914]" displayed="true">
                        <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="《用户协议》" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[352,869][534,914]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.widget.TextView index="6" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="和" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[534,869][567,914]" displayed="true" />
                      <android.view.ViewGroup index="7" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[567,869][749,914]" displayed="true">
                        <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="《隐私政策》" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[567,869][749,914]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.view.ViewGroup index="8" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,957][1025,1150]" displayed="true">
                        <android.view.ViewGroup index="0" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,1012][1025,1150]" displayed="true">
                          <android.view.View index="0" package="com.yeqin.enterpriseservice" class="android.view.View" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,1012][1025,1150]" displayed="true" />
                          <android.widget.TextView index="1" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="登录" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[496,1051][584,1110]" displayed="true" />
                        </android.view.ViewGroup>
                      </android.view.ViewGroup>
                      <android.view.ViewGroup index="9" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,1205][250,1257]" displayed="true">
                        <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="新用户注册" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[55,1205][250,1257]" displayed="true" />
                      </android.view.ViewGroup>
                      <android.view.ViewGroup index="10" package="com.yeqin.enterpriseservice" class="android.view.ViewGroup" text="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[250,1205][1025,1257]" displayed="true">
                        <android.widget.TextView index="0" package="com.yeqin.enterpriseservice" class="android.widget.TextView" text="短信验证码登录" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[250,1205][1025,1257]" displayed="true" />
                      </android.view.ViewGroup>
                    </android.view.ViewGroup>
                  </android.view.ViewGroup>
                </android.view.ViewGroup>
              </android.view.ViewGroup>
            </android.widget.FrameLayout>
          </android.widget.FrameLayout>
        </android.widget.LinearLayout>
      </android.widget.FrameLayout>
    </android.widget.LinearLayout>
  </android.widget.FrameLayout>
</hierarchy>

//*[contains(@text, '我已阅读')]/../android.widget.ImageView

感觉这样就可以找到了吧,你要定位的应该是那个ImageView

还是不行,不知道是不是找不到父路径的原因,打印的日志里面,current xpath并不是我写的路径,而是current xpath = //[@resource-id=“com.yeqin.enterpriseservice:id/action_bar_root”]//[@resource-id=“android:id/content”]
部分日志如下
2021-05-20 14:33:43 INFO [AutomationSuite.31.$anonfun$new$2] //*[contains(@text, ‘我已阅读并同意’)]/…/android.widget.ImageView

2021-05-20 14:33:43 INFO [AutomationSuite.32.$anonfun$new$2] click

2021-05-20 14:33:43 INFO [Crawler.996.doElementAction] current element = Steps.tag=ImageView.depth=12

2021-05-20 14:33:43 INFO [Crawler.997.doElementAction] current index = 5

2021-05-20 14:33:43 INFO [Crawler.998.doElementAction] current action = click

2021-05-20 14:33:43 INFO [Crawler.999.doElementAction] current xpath = //[@resource-id=“com.yeqin.enterpriseservice:id/action_bar_root”]//[@resource-id=“android:id/content”]

2021-05-20 14:33:43 INFO [Crawler.1000.doElementAction] current url = Steps

2021-05-20 14:33:43 INFO [Crawler.1001.doElementAction] current tag path = hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView

2021-05-20 14:33:43 INFO [Crawler.1002.doElementAction] current file name = Steps.tag=ImageView.depth=12

2021-05-20 14:33:43 INFO [AppCrawler$.59.saveReqHash] save reqHash to 5

2021-05-20 14:33:43 INFO [AppCrawler$.92.saveReqImg] save reqImg 20210518145849/5_Steps.tag=ImageView.depth=12.click.png to 5

2021-05-20 14:33:43 INFO [AppCrawler$.76.saveReqDom] save reqDom to 5

2021-05-20 14:33:43 INFO [Crawler.1071.doElementAction] need input click

2021-05-20 14:33:43 INFO [AppiumClient.53.findElementByURI] find by uri element= Steps.tag=ImageView.depth=12

2021-05-20 14:33:43 INFO [AppiumClient.245.findElementsByURI] findElementByAndroidUIAutomator new UiSelector().className(“android.widget.ImageView”)

2021-05-20 14:33:43 INFO [AppiumClient.60.findElementByURI] find by xpath success
尝试了多种路径,xpath如果里面如果加父节点,current xpath都是错误的,只有子节点//*才是对的

# - xpath: "//*[@text='我已阅读并同意']//*[@class='android.view.ViewGroup'][3]"-----可以拼到该current_xpath中,current xpath显示正确
# - xpath: "//*[@text='我已阅读并同意']//parent::*//*[@class='android.view.ViewGroup'][3]"--无法拼到current_xpath里面,current xpath=//*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]
# - xpath: "//*[@text='我已阅读并同意']/..//*[contains(@class,'android.view.ViewGroup')][3]"--无法拼到current xpath里面,current xpath=//*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]
# - xpath: "//*[contains(@text, '我已阅读')]/../android.widget.ImageView"---无法拼到current_xpath里面,current xpath=//*[@resource-id="com.yeqin.enterpriseservice:id/action_bar_root"]//*[@resource-id="android:id/content"]

appcrawler会把你的xpath转成他自己的一种唯一定位xpath,根据默认的一些规则,比如带上class text index desc id相关的属性