|
最近开始使用monkeyrunner测试app[size=14px]#####################[/size]
# log output way #
#####################
def program_traffic():
log=open('C:\Users\guji\Desktop\log\Bug#44169.txt','w')
for loop3 in range(100):
programBack_button=device.touch(122,322,'DOWN_AND_UP')
mr.sleep(1)
print ('times==>'),loop3
print (time.strftime('%y,%m,%d %H:%M',time.localtime(time.time())))
print >> log, 'operation times==>',loop3
print >> log, time.strftime('%y,%m,%d %H:%M',time.localtime(time.time()))
log.close()
def click_action():
# x=coordinate_x_list
# y=coordinate-y_list
x_list=[341,44]
y_list=[353,87]
print x_list,y_list
list_index=len(x_list)
for i in range(list_index):
x=x_list
y=y_list
device.touch(x,y,'DOWN_AND_UP')
mr.sleep(2)
device.press('KEYCODE_BACK')
mr.sleep(2)
print ('Done')
但是感觉自己写的太简单了,想请教各位高手进行指点,如何能写的比较细致
|
|