关于munkeyrunner脚本运行的一些问题
想测试一下在输入框内连续100次快速输入评论并发送,然后写了一小段脚本,运行之后,会重复的使用输入法重复输入,但就是不点发送TUT#!/usr/bin/python
#coding=utf-8
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
#连接设备
device=MonkeyRunner.waitForConnection(3)
device.startActivity("com.paid/.MainActivity")
MonkeyRunner.sleep(5)
device.touch(1000,120,"DOWN_AND_UP")
MonkeyRunner.sleep(2)
device.touch(500,1850,"DOWN_AND_UP")
device.type("1")
i=0
if i<=100:
#在输入框内输入q
device.type("q")
MonkeyRunner.sleep(0.8)
#点击发送按钮
device.touch(1000,1000,"DOWN_AND_UP")
i=i+1
else:
print("结束啦,101个数")
:victory: TUT
页:
[1]