<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                (上篇文章寫完才發現,說好的按順序但是回頭一看完全不是按順序的)明明WaitForIdle才是第一個。哎,老了,后腦勺不行了。 # WaitForIdle ~~~ package io.appium.android.bootstrap.handler; import com.android.uiautomator.core.UiDevice; import io.appium.android.bootstrap.AndroidCommand; import io.appium.android.bootstrap.AndroidCommandResult; import io.appium.android.bootstrap.CommandHandler; import org.json.JSONException; import java.util.Hashtable; /** * This handler is used to clear elements in the Android UI. * * Based on the element Id, clear that element. * */ public class WaitForIdle extends CommandHandler { /* * @param command The {@link AndroidCommand} * * @return {@link AndroidCommandResult} * * @throws JSONException * * @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android. * bootstrap.AndroidCommand) */ @Override public AndroidCommandResult execute(final AndroidCommand command) throws JSONException { final Hashtable<String, Object> params = command.params(); long timeout = 10; if (params.containsKey("timeout")) { timeout = (Integer) params.get("timeout"); } UiDevice d = UiDevice.getInstance(); d.waitForIdle(timeout); return getSuccessResult(true); } } ~~~ 上面的代碼處理過程很簡單,首先都是獲取命令里面的參數,然后初始化一個timeout私有變量,如果參數里不含時間,那么就用這個默認的時間。然后調用uiautomator的UiDevice的對象里方法waitForIdle(),該方法就在timeout時間內界面上沒有其他操作,處于空閑狀態。這個就是封裝了一下UiDevice的waitForIdle方法而已沒啥可講的。 # Clear ~~~ package io.appium.android.bootstrap.handler; import com.android.uiautomator.core.UiObjectNotFoundException; import io.appium.android.bootstrap.*; import org.json.JSONException; /** * This handler is used to clear elements in the Android UI. * * Based on the element Id, clear that element. * */ public class Clear extends CommandHandler { /* * @param command The {@link AndroidCommand} * * @return {@link AndroidCommandResult} * * @throws JSONException * * @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android. * bootstrap.AndroidCommand) */ @Override public AndroidCommandResult execute(final AndroidCommand command) throws JSONException { if (command.isElementCommand()) { try { final AndroidElement el = command.getElement(); el.clearText(); return getSuccessResult(true); } catch (final UiObjectNotFoundException e) { return new AndroidCommandResult(WDStatus.NO_SUCH_ELEMENT, e.getMessage()); } catch (final Exception e) { // handle NullPointerException return getErrorResult("Unknown error clearing text"); } } return getErrorResult("Unknown error"); } } ~~~ Clear的方法中就看e1.clearText()方法,其他的我在click中都有涉及。 ~~~ private final UiObject el; public void clearText() throws UiObjectNotFoundException { el.clearTextField(); } ~~~ 實際上調用的是uiautomator中的UiObject.clearTextField(),清楚文本框內的內容。
                  <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>

                              哎呀哎呀视频在线观看