当前位置:天才代写 > tutorial > Python教程 > python monkeyrunner 代码示例

python monkeyrunner 代码示例

2018-05-18 08:00 星期五 所属: Python教程 浏览:510

python">'''from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice'''
import sys
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
from com.android.monkeyrunner.easy import EasyMonkeyDevice
from com.android.monkeyrunner.easy import By

device=MonkeyRunner.waitForConnection(1.0,'d1d4c874')
device.startActivity(component='com.broadvision.myvmoso.phone.myvmoso.enterprise/com.broadvision.myvv.MyVV_Splash')
'''easy_device=EasyMonkeyDevice(device)'''
MonkeyRunner.sleep(5)
result=device.takeSnapshot()
result.writeToFile('./shotbegin.png','png')
'''
for i in range(15):
 device.touch(134,145,"DOWN")
 MonkeyRunner.sleep(5)
 device.touch(134,145,"DOWN_AND_UP")
 MonkeyRunner.sleep(5)
 device.touch(134,145,"UP")
 MonkeyRunner.sleep(5)
'''
'''easy_device.touch(By.id('id/focus_create_priority_no'),"DOWN_AND_UP")'''
'''device.press('KEYCODE_BACK',"DOWN_AND_UP")'''
device.touch(380,800,"DOWN_AND_UP")
MonkeyRunner.sleep(5)
result=device.takeSnapshot()
result.writeToFile('./shotend.png','png')

标签:python

 

    关键字:

天才代写-代写联系方式