<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # UIAutomatorViewer 教程:Android 測試檢查器 > 原文: [https://www.guru99.com/uiautomatorviewer-tutorial.html](https://www.guru99.com/uiautomatorviewer-tutorial.html) ## 什么是 UiAutomatorViewer? “ UIautomatorviewer”是用于掃描和分析 Android 應用程序的 UI 組件的 GUI 工具。要使用 Appium 自動化任何 Android 應用程序,用戶需要在 AUT(被測應用程序)中標識對象。 使用“ UIautomatorviewer”,您可以檢查 android 應用程序的 UI,以查找層次結構并查看元素的不同屬性(id,text…)。 在執行自動化腳本時,Appium 使用“ Uiautomatorviewer”來標識對象的不同屬性,并使用這些屬性來標識所需的對象。 ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/bc/39/bc398021e59d5e1fa50686166fd012c1_974x705.png "Uiautomatorviewer Tutorial") 在本教程中,您將學習- * [如何下載&安裝 UIAutomator](#1) * [如何使用 Uiautomatorviewer 在我的應用程序中查找對象](#2) * [如何使用這些屬性來標識自動化元素](#3) * [使用 Uiautomatorviewer](#4) 時可能會遇到錯誤 ## 如何下載&安裝 UIAutomator “ Uiautomatorviewer”是 Android SDK 管理器的一部分,安裝 SDK 管理器后即可訪問。 在上從[下載并安裝 Android SDK 管理器](http://developer.android.com/sdk/index.html) 安裝 Android SDK 后,導航至鏈接 ``` c:\users\<username>\AppData\Local\Android\sdk\tools ``` You'll notice a batch file with name ``` uiautomatorviewer.bat ``` . Double click on it to launch "Uiautomatorviewer" GUI ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/5a/66/5a664dabbceed56eb4778ebeff2bfdbb_588x509.png "Uiautomatorviewer Tutorial") ## 如何使用 Uiautomatorviewer 在我的應用程序中查找對象 1. 在設備上啟用“開發人員”選項。 單擊此處的[了解如何在 Android 設備上啟用開發人員選項](https://developer.android.com/studio/debug/dev-options) 2. 通過 USB 電纜將 android 設備連接到 PC 3. 從應用程序中選擇“ Guru99”應用程序 ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/9a/53/9a5357d67b7bf7d18af5c01a0c211db9_369x655.png "Uiautomatorviewer Tutorial") 4. 單擊“設備屏幕截圖”按鈕以刷新“ Uiautomatorviewer”,并在“ Uiautomatorviewer”上加載 guru99 應用程序 GUI ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/58/94/5894231dd758fb1b4747a950b2cd6ade_800x600.png "Uiautomatorviewer Tutorial") 5. 刷新完成后,將打開 Guru99 應用程序的屏幕截圖。 ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/0d/91/0d9110875df69182977e94bdb7428580_841x600.png "Uiautomatorviewer Tutorial") 6. 如上圖所示,在窗口的右側有 2 個面板。 上面板包含 UI 組件的排列和包含方式的節點層次結構,單擊每個節點可在下面板中提供 UI 元素的屬性 7. 選擇上圖中的“ **測驗**”按鈕以查看不同的屬性(文本,資源 ID ...) ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/5f/06/5f0625c602d2d774a544ff7d71601bc5_930x600.png "Uiautomatorviewer Tutorial") ## 如何使用這些屬性來標識自動化元素 好吧,您不能直接使用屬性,每個屬性都有其他名稱。 讓我們看看如何使用這些屬性值來工作。 以下屬性可用于標識 Guru99 應用中的“ **測驗**”按鈕。 * **文本**屬性可以用作“ **名稱”** ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/a2/44/a244d518fe595c00a5d42500ebdc3dbf_582x43.png "Uiautomatorviewer Tutorial") * **resource-id** 屬性可以用作“ **id”** ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/02/08/0208f2dbc79ad41657b9071a7138d11c_745x36.png "Uiautomatorviewer Tutorial") * **類**屬性可以用作“ **className”** ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/00/8d/008d53ab3d8b68dd62c8fde27656c9ce_741x43.png "Uiautomatorviewer Tutorial") * **content-desc** attribute can be used as "**AccessibilityId"** ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/79/3b/793ba72d982b519e105d81f889ac979c_624x39.png "Uiautomatorviewer Tutorial") 連同以上屬性,我們可以編寫 xpath 來進行對象識別 ## 使用 Uiautomatorviewer 時可能遇到錯誤 * 我看到錯誤-“ adb 未檢測到 Android 設備”,如下面的屏幕截圖所示,我該如何解決此問題 ![Uiautomatorviewer Tutorial](https://img.kancloud.cn/38/9b/389b4c19515586b395aa095a6b4176e8_800x600.png "Uiautomatorviewer Tutorial") **解決方案:**確保您的設備已連接到 PC
                  <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>

                              哎呀哎呀视频在线观看