早教吧作业答案频道 -->英语-->
monkeyrunner脚本报错,不加foriinrange一切正常,加了就报错#Importsthemonkeyrunnermodulesusedbythisprogramfromcom.android.monkeyrunnerimportMonkeyRunner,MonkeyDevice,MonkeyImage#Connectstothecurrentdevice,returningaMon
题目详情
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')
# 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')
▼优质解答
答案和解析
for i in range(次数):
循环脚本
------------------------------------
报错了一定是你脚本写错了
循环脚本
------------------------------------
报错了一定是你脚本写错了
看了 monkeyrunner脚本...的网友还看了以下:
一道java编程题:有一矩阵:a b c d e f g h i j k l m n o p q 2020-04-06 …
①A·—②B—···③C—·—·④D—··⑤E·⑥F··—·⑦G——·⑧H····⑨I··⑴J·— 2020-05-24 …
在一个关系模式R(M,N,O,P)中,若各个属性问没有任何函数依赖关系,则该模式的主属性有( 2020-05-24 …
在一个关系模式R(M, N, O, P)中,若各个属性间没有任何函数依赖关系,则该模式的主属性有() 2020-05-24 …
用以下英文宇母填在上a,a,a,a,a,a,b,e,e,d,e,e,e,e,e,e,f,g,g用以 2020-06-24 …
"A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X, 2020-06-29 …
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y 2020-07-21 …
js正则验证A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V 2020-07-23 …
英文字母歌连读国外的英文字母歌是把l,m,n,o,p连在一起读的,但是究竟是怎么个读法? 2020-11-07 …
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,这20个字母的两两组 2020-11-07 …