转:MonkeyRunner_MonkeyRunner实例收集

上一篇 / 下一篇  2013-01-29 17:16:45

以下是MonkeyRunner的一些实例,大家可以参考:

例句1:
device.press("DPAD_DOWN", MonkeyDevice.DOWN_AND_UP) or device.press("DPAD_UP", MonkeyDevice.DOWN_AND_UP)

例句2:

to reach the particular button and then click that button using device.press("DPAD_CENTER", MonkeyDevice.DOWN_AND_UP)

例句3:

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice  
from com.android.monkeyrunner.easy import EasyMonkeyDevice, By  
device = MonkeyRunner.waitForConnection()  
easy_device = EasyMonkeyDevice(device)  
# Start your android app
# touch the view by id
easy_device.touch(By.id('view_id'), MonkeyDevice.DOWN_AND_UP)

例句4:

device.getProperty("display.width"),device.getProperty("display.height") and device.getProperty("display.density")

例句5:

print str(device.getProperty('build.model')) #获得手机型号

print str(device.getProperty('build.board')) #获得手机型号

print str(device.getProperty('build.device')) #获得手机型号

例句6:

print str(device.getProperty('build.fingerprint'))  #结果为:Meizi/meizi_m9/m9:2.3.5/GRJ90/eng.mobileapp.20120110.135237:user/test-keys

print str(device.getProperty('build.brand'))  #结果为:1326174777000


TAG:

小天天的个人空间 引用 删除 小天天   /   2014-06-05 16:39:42
 

评分:0

我来说两句

日历

« 2024-05-14  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 19629
  • 日志数: 17
  • 建立时间: 2013-01-24
  • 更新时间: 2013-04-07

RSS订阅

Open Toolbar