Name | Date | Size | |
---|---|---|---|
.. | 21-Nov-2012 | 4 KiB | |
By.java | 21-Nov-2012 | 2.3 KiB | |
EasyMonkeyDevice.java | 21-Nov-2012 | 8.1 KiB | |
README | 21-Nov-2012 | 1.1 KiB |
README
1com.android.monkeyrunner.easy contains classes intended to make it easier 2to interact with applications using the MonkeyRunner framework. Instead of 3referencing a button or input box by x,y coordinate, they can be referenced 4by identifier, as in the following Python example: 5 6############################################################################## 7 8from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice 9from com.android.monkeyrunner.easy import EasyMonkeyDevice 10from com.android.monkeyrunner.easy import By 11 12# Connect to the current device. 13device = MonkeyRunner.waitForConnection() 14 15# Use the EasyMonkey API, all methods on device are available in easy_device. 16easy_device = EasyMonkeyDevice(device) 17 18if not easy_device.visible(By.id('id/all_apps_button')): 19 raise Error('Could not find the "all apps" button') 20 21print "Location of element:", easy_device.locate(By.id('id/all_apps_button')) 22 23easy_device.touch(By.id('id/all_apps_button'), 'DOWN_AND_UP') 24 25############################################################################## 26 27WARNING: This API is under development and may change without notice. 28