使用 findElementByClassName、findElementByXPath、findElementByXPath 均不能找到元素,不知道怎么办。
我使用 driver.getPageSource() 可以获取以下内容,为什么就是找不到呢?

<?xml version="1.0" encoding="UTF-8"?><AppiumAUT><XCUIElementTypeApplication type="XCUIElementTypeApplication" value="AX error -25205" name="AX error -25205" label=" " enabled="true" visible="true" x="0" y="0" width="375" height="667">
  <XCUIElementTypeWindow type="XCUIElementTypeWindow" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="0" width="375" height="667">
    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="0" width="375" height="667">
      <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="0" width="375" height="667">
        <XCUIElementTypeNavigationBar type="XCUIElementTypeNavigationBar" value="AX error -25205" name="SBSearchEtceteraIsolatedView" label="AX error -25205" enabled="true" visible="true" x="0" y="20" width="375" height="48">
          <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="20" width="375" height="48">
            <XCUIElementTypeTextField type="XCUIElementTypeTextField" value="搜索" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="8" y="24" width="359" height="36">
              <XCUIElementTypeTextField type="XCUIElementTypeTextField" value="搜索" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="8" y="24" width="359" height="36"/>
            </XCUIElementTypeTextField>
          </XCUIElementTypeOther>
        </XCUIElementTypeNavigationBar>
        <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="0" width="375" height="667">
          <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="0" width="375" height="667">
            <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="599">
              <XCUIElementTypeScrollView type="XCUIElementTypeScrollView" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                  <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                      <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                        <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                          <XCUIElementTypeCollectionView type="XCUIElementTypeCollectionView" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="569">
                            <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="true" x="0" y="68" width="375" height="60">
                              <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="AX error -25205" name="AX error -25205" label="最近通知" enabled="true" visible="true" x="20" y="89" width="114" height="34"/>
                              <XCUIElementTypeButton type="XCUIElementTypeButton" value="AX error -25205" name="AX error -25205" label="清除通知" enabled="true" visible="true" x="305" y="94" width="55" height="22"/>
                            </XCUIElementTypeOther>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 现在, 推送-打开APP" enabled="true" visible="true" x="8" y="128" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="true" x="8" y="210" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="true" x="8" y="292" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="false" x="8" y="374" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="true" x="8" y="456" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="true" x="8" y="538" width="359" height="74"/>
                            <XCUIElementTypeCell type="XCUIElementTypeCell" value="AX error -25205" name="AX error -25205" label="病历夹PUB, 2 小时前, 推送-打开APP" enabled="true" visible="true" x="8" y="620" width="359" height="74"/>
                          </XCUIElementTypeCollectionView>
                        </XCUIElementTypeOther>
                      </XCUIElementTypeOther>
                    </XCUIElementTypeOther>
                  </XCUIElementTypeOther>
                </XCUIElementTypeOther>
              </XCUIElementTypeScrollView>
            </XCUIElementTypeOther>
          </XCUIElementTypeOther>
        </XCUIElementTypeOther>
      </XCUIElementTypeOther>
    </XCUIElementTypeOther>
  </XCUIElementTypeWindow>
  <XCUIElementTypeWindow type="XCUIElementTypeWindow" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667"/>
    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667"/>
  </XCUIElementTypeWindow>
  <XCUIElementTypeWindow type="XCUIElementTypeWindow" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667"/>
  </XCUIElementTypeWindow>
  <XCUIElementTypeWindow type="XCUIElementTypeWindow" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
      <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
        <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
          <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
            <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
              <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
                <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667"/>
                <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
                  <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667">
                    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label="AX error -25205" enabled="true" visible="false" x="0" y="0" width="375" height="667"/>
                    <XCUIElementTypeOther type="XCUIElementTypeOther" value="AX error -25205" name="AX error -25205" label=...

求助~~


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