monkeyrunner脚本报错,不加for i in range一切正常,加了就报错# Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage# Connects to the current device,returning a Mon

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 04:33:35
monkeyrunner脚本报错,不加for i in range一切正常,加了就报错# Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage# Connects to the current device,returning a Mon

monkeyrunner脚本报错,不加for i in range一切正常,加了就报错# Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage# Connects to the current device,returning a Mon
monkeyrunner脚本报错,不加for i in range一切正常,加了就报错
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
# Connects to the current device,returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
# Runs the component
device.startActivity(component = "com.cyou.mrd.fk/cn.cmgame.billing.ui.GameOpenActivity")
MonkeyRunner.sleep(5)
device.touch(253,558,'DOWN_AND_UP')
MonkeyRunner.sleep(5)
device.touch(345,510,'DOWN_AND_UP')
MonkeyRunner.sleep(5)
device.touch(231,538,'DOWN_AND_UP')
MonkeyRunner.sleep(10)
for i in range(1,3):
device.drag((13,646),(462,646),0.1,1)
MonkeyRunner.sleep(1)
device.drag((462,646),(10,646),0.1,1)
MonkeyRunner.sleep(1)
device.touch(450,36,'DOWN_AND_UP')
MonkeyRunner.sleep(1)
device.touch(184,448,'DOWN_AND_UP')

monkeyrunner脚本报错,不加for i in range一切正常,加了就报错# Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage# Connects to the current device,returning a Mon
for i in range(次数):
循环脚本
------------------------------------
报错了一定是你脚本写错了