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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## Swipe 故障排查手冊 ### 簡單 swipe 動作 采用以下步驟進行故障排查: 1. 添加觸摸點坐標的日志 帶有日志的滑屏操作示例: ```java /** * Performs swipe from the center of screen * * @param dir the direction of swipe * @version java-client: 7.3.0 **/ public void swipeScreenWithLogs(Direction dir) { System.out.println("swipeScreen(): dir: '" + dir + "'"); // 總在日志中記錄執行的操作 // 默認動畫時長: // - Android: 300 ms // - iOS: 200 ms // final value depends on your app and could be greater final int ANIMATION_TIME = 200; // ms final int PRESS_TIME = 200; // ms int edgeBorder = 10; // better avoid edges Point pointStart, pointEnd; PointOption pointOptionStart, pointOptionEnd; // init screen variables Dimension dims = driver.manage().window().getSize(); // init start point = center of screen pointStart = new Point(dims.width / 2, dims.height / 2); switch (dir) { case DOWN: // center of footer pointEnd = new Point(dims.width / 2, dims.height - edgeBorder); break; case UP: // center of header pointEnd = new Point(dims.width / 2, edgeBorder); break; case LEFT: // center of left side pointEnd = new Point(edgeBorder, dims.height / 2); break; case RIGHT: // center of right side pointEnd = new Point(dims.width - edgeBorder, dims.height / 2); break; default: throw new IllegalArgumentException("swipeScreen(): dir: '" + dir.toString() + "' NOT supported"); } // execute swipe using TouchAction pointOptionStart = PointOption.point(pointStart.x, pointStart.y); pointOptionEnd = PointOption.point(pointEnd.x, pointEnd.y); System.out.println("swipeScreen(): pointStart: {" + pointStart.x + "," + pointStart.y + "}"); System.out.println("swipeScreen(): pointEnd: {" + pointEnd.x + "," + pointEnd.y + "}"); System.out.println("swipeScreen(): screenSize: {" + dims.width + "," + dims.height + "}"); try { new TouchAction(driver) .press(pointOptionStart) // a bit more reliable when we add small wait .waitAction(WaitOptions.waitOptions(Duration.ofMillis(PRESS_TIME))) .moveTo(pointOptionEnd) .release().perform(); } catch (Exception e) { System.err.println("swipeScreen(): TouchAction FAILED\n" + e.getMessage()); return; } // always allow swipe action to complete try { Thread.sleep(ANIMATION_TIME); } catch (InterruptedException e) { // ignore } } ``` 示例輸出: ``` swipeScreen(): dir: 'DOWN' swipeScreen(): pointStart: {187,333} swipeScreen(): pointEnd: {187,657} swipeScreen(): screenSize: {375,667} swipeScreen(): dir: 'UP' swipeScreen(): pointStart: {187,333} swipeScreen(): pointEnd: {187,10} swipeScreen(): screenSize: {375,667} ``` 2. Android設置里開啟'顯示Taps位置'和'指針位置',在'設置 -> 系統 -> 開發者選項 -> tab輸入'顯示操作的位置坐標. 3. 手動執行相同的滑屏動作以驗證。 ### Android: 'UIScrollable' 滑動(swipe) #### 滑動沒有開始: 1. 檢查是否有多個滑動視圖(scrollViews). 如果有多個,通過instance/resource-id/classname/等方式指定具體的某一個。 2. 檢查滑動視圖的布局方向,使用'setAsVerticalList'或'setAsHorizontalList'來設置布局方向。 3. 混合使用上述兩種方式。 4. 都失敗的話,嘗試使用簡單元素滑動方式。 #### 找不到查找的元素: 1. 查找前添加暫停動作,在此期間手動滑屏讓查找的元素出現。暫停后添加代碼檢查是否可以找到元素。下面的例子使用文本查找方式來演示—— ```java MobileElement element = (MobileElement) driver.findElement(MobileBy.AndroidUIAutomator( "new UiSelector().text(\"exact_text\")")); // or MobileElement element = (MobileElement) driver.findElement(MobileBy.AndroidUIAutomator( "new UiSelector().textContains(\"part_text\")")); try { System.out.println("Element found: " + !element.getId().isEmpty()); } catch (Exception e) { System.out.println("Element found: false"); } ``` ### iOS: 'mobile:scroll', 'mobile:swipe' 滑動(swipe) #### 滑動沒有開始: 1. 檢查方向,注意'scroll'和'swipe'方法的方向參數不同。 2. 都失敗的話,嘗試使用簡單元素滑動方式。 #### 找不到查找的元素: 1. 嘗試使用精準swipe而不是scroll方法 2. 有時當查找的元素只出現一部分的話,tap動作將可能失敗。此時,使用簡單部分元素滑動(Simple-partial-element)——就像在簡單半屏例子種演示的那樣——中的策略重試一下。同時執行部分元素滑動(partial element swipe)操作后,再重試一下tap動作。
                  <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>

                              哎呀哎呀视频在线观看