uiautomator执行脚本向微信发送消息,很多条,总是发几条失败,是输入法的原因吗?
//循环发送消息
for(int i=0;i<5;i++){
//消息体-随机数
//Random random = new Random();
//int a=random.nextInt(10);
mess.setText(String.valueOf(i));
//mess.setText("aa");
sleep(2000);
//点击发送
UiObject send = new UiObject(new UiSelector().text("发送"));
send.click();
sleep(2000);
}
//循环发送消息
for(int i=0;i<5;i++){
//消息体-随机数
//Random random = new Random();
//int a=random.nextInt(10);
mess.setText(String.valueOf(i));
//mess.setText("aa");
sleep(2000);
//点击发送
UiObject send = new UiObject(new UiSelector().text("发送"));
send.click();
sleep(2000);
}