I have a pretty basic script where I intend for the application to drag 3 times, and then touch a button. The application drags three times perfectly, but then get's an error when I add in the touch code.
Code:
device, serialno = ViewClient.connectToDeviceOrExit())
device.drag((120, 220), (300, 220), 1, 20)
MonkeyRunner.sleep(5)
device.drag((120, 220), (300, 220), 1, 20)
MonkeyRunner.sleep(3)
device.drag((120, 220), (300, 220), 1, 20)
temp = device.findViewWithText('Lesson 1')
temp.touch()
Error:
line 34, in <module>
device, serialno = ViewClient(*ViewClient.connectToDeviceOrExit())
TypeError: 'instance' object is not iterable
New Code:
device, serialno = ViewClient.connectToDeviceOrExit()
temp = device.findViewWithText('Lesson')
New Error:
temp = device.findViewWithText('Audiobooks')
AttributeError: 'com.android.monkeyrunner.MonkeyDevice' object has no attribute 'findViewWithText'