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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                之前的系列給出了Appium,Robotium,Instrumentation和UIAutomator創建一個Note實例的例子: - 《[Appium創建一個Note的實例](http://blog.csdn.net/zhubaitian/article/details/39502069)》 - 《[Robotium創建一個Note的實例](http://blog.csdn.net/zhubaitian/article/details/39502119)》 - 《[UIAutomator創建一個Note的實例](http://blog.csdn.net/zhubaitian/article/details/39508513)》 - 《[SDK Instrumentation創建一個Note的實例](http://blog.csdn.net/zhubaitian/article/details/39546371)》 那么用MonkeyRunner又是如何實現這些功能的呢?今天花了點時間學習了下MonkeyRunner的基本API然后嘗試實現了該功能,給我作為一個初學者的感觸如下: - MonkeyRunner可以通過坐標點擊對象,在引入EasyMonkeyDevice后可以根據ID進行點擊 - Eclipse上Jython代碼很多對象沒有成員函數提示(jar包以導入),如MonkeyRunner.waitForConnection獲得device對象后,后面devie.不能自動提示可用成員函數 - 感覺腳本跑得很慢 - 沒有任何junit的繼承,應該可以通過Junit4框架來使用MonkeyRunner,下次有時間再嘗試下 - 也許是不熟悉,感覺跟Robotium,UIAutomator等的編寫效率差一些 ~~~ from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice from com.android.monkeyrunner.easy import EasyMonkeyDevice,By #Connect to the target device device = MonkeyRunner.waitForConnection("10000", "emulator-5554") easy_device = EasyMonkeyDevice(device) #touch a button by id would need this device.startActivity(component="com.example.android.notepad/com.example.android.notepad.NotesList") #time.sleep(2000) #invoke the menu options MonkeyRunner.sleep(3) device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP); #Touch on the "Add note" menu entry by coordinate MonkeyRunner.sleep(3) device.touch(118,253,MonkeyDevice.DOWN_AND_UP) #Type in the text for the note MonkeyRunner.sleep(3) device.type('Note1') #easy_device.type(By.id('id/note'),'Note2') #invoke the menu options MonkeyRunner.sleep(3) device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP); #Touch on the "save" menu entry by coordinate MonkeyRunner.sleep(3) device.touch(59,257,MonkeyDevice.DOWN_AND_UP) #Simulate long press on the new added note by id with EasyMonkeyDevice MonkeyRunner.sleep(3) easy_device.touch(By.id('id/text1'),MonkeyDevice.DOWN) #Touch down for 10 seconds MonkeyRunner.sleep(10) easy_device.touch(By.id('id/text1'),MonkeyDevice.UP) #Then release the touch #Touch on the "delete" menu entry of the context menu options to delete the note MonkeyRunner.sleep(6) device.touch(84,172,MonkeyDevice.DOWN_AND_UP) ~~~
                  <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>

                              哎呀哎呀视频在线观看