<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## 使用uiautomator定位 `driver.find_element_by_android_uiautomator(uia_string)` *uia_string:uia_string - The element name in the Android UIAutomator library* 使用UIAutomator元素屬性名稱來定位 ### 根據 resourceId 屬性 定位 ``` driver.find_element_by_android_uiautomator('new UiSelector().resourceId("%s")') ``` 舉例:如下圖,點擊頂部掃碼器: ![](https://box.kancloud.cn/6e19e34fb58140d741a1a7cd8e7770bc_1221x563.png) **對應uiautomator名稱:“resource-id”:** ``` driver.find_element_by_android_uiautomator('new UiSelector().resourceId("com.rfchina.app.supercommunity:id/square_title_btn_scan")').click() ``` >[warning] 選擇resource-id 定位需要特別注意,界面中 resource-id 不是唯一的,有可能存在很多控件的resource-id是相同的。 ### 根據 text、description、className、index屬性定位 ``` # 根據 text 定位 driver.find_element_by_android_uiautomator('new UiSelector().text("%s")') #對應uiautomator名稱:“text” # 根據 description 定位 driver.find_element_by_android_uiautomator('new UiSelector().description("%s")') # 對應uiautomator名稱:“content-desc” # 根據 className 定位 driver.find_element_by_android_uiautomator('new UiSelector().className("%s")') # 對應uiautomator名稱:“class” # 根據 index 定位 driver.find_element_by_android_uiautomator('new UiSelector().index("%s")') # 對應uiautomator名稱:“index” ``` >[warning] 選擇className 定位需要特別注意,界面中 class 往往都不是唯一的,大量控件的class會一樣。 <br> ## 根據content-desc定位 `driver.find_element_by_accessibility_id()` ## 根據xpath定位 `driver.find_element_by_xpath()` ```python from appium import webdriver import time desired_caps = { "appPackage": "com.rfchina.app.supercommunity", "appActivity": "com.rfchina.app.supercommunity.client.StartActivity", "platformName": "Android", "deviceName": "Android Emulator" } driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) time.sleep(5) driver.find_element_by_id("com.rfchina.app.supercommunity:id/img_serivce_communities_layout").click() ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看