0

MonkeyRunner.sleep (5) gives an error when I type. I wonder why I wrote no problem 3?

Google translate

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
device = MonkeyRunner.waitForConnection()
device.touch(112, 149, "DOWN_AND_UP")
MonkeyRunner.sleep(5)
device.touch(139, 173, "DOWN_AND_UP")
31019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Error se
nding touch event: 139 153 DOWN_AND_UP
131019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice]java.net.
SocketException: Software caused connection abort: recv failed
131019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketInputStream.socketRead0(Native Method)
131019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketInputStream.read(Unknown Source)
131019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketInputStream.read(Unknown Source)
131019 13:33:34.222:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.n
io.cs.StreamDecoder.readBytes(Unknown Source)
Gokhan
  • 1
  • 1

1 Answers1

2

use as below in you code:-

device.touch(112, 149, "MonkeyDevice.DOWN_AND_UP")
MonkeyRunner.sleep(5)
device.touch(139, 173, "MonkeyDevice.DOWN_AND_UP")

And for sleep you can use below method also!

try:-

import time
time.sleep(5)
Rilwan
  • 2,251
  • 2
  • 19
  • 28