MonkeyRunner_MonkeyRunner实例收集

以下是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



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值