Monkeyrunner學習之二(如何使用id去點選的方法)
阿新 • • 發佈:2019-02-08
Monkeyrunner學習之一中學習到如何檢視控制元件id,接下來我們學習Monkeyrunner如何使用id去點選的方法
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
from com.android.monkeyrunner import MonkeyImage
from com.android.monkeyrunner.easy import EasyMonkeyDevice
from com.android.monkeyrunner.easy import By
device = MonkeyRunner.waitForConnection()
easy_device = EasyMonkeyDevice(device)
device.startActivity(component='com.android.contacts/com.android.contacts.DialtactsContactsEntryActivity')
easy_device.touch(By.id('id/account_name'),MonkeyDevice.DOWN_AND_UP)
轉載的連結忘記了。。。