I am trying to automatically scroll the browser using monkeyrunner. So far I can scroll by "Drag" event, but how can I scroll by "Flick". I appreciate if you can give me some hits or instructions.
Using drag:
for i in range(1, 40):
device.drag((400,700),(400,300),0.15,1)
MonkeyRunner.sleep(.7071)
edit
We cannot replicate the pressure using Monkeyrunner so we cannot do the flick. Just dragging is only way we have for now
MonkeyDevice.java
doesn't have any flick method in it, but you can adjust the duration parameter to drag
, which appears to be the third argument. A fling is basically a very quick drag, so perhaps by reducing the duration to a very small number (0.01, maybe?) you can get the emulator or device to respond to a fling.
As a work around, why not just 'drag' it many times?
It may take a little bit of work, but you should be able to reproduce the flick effect by performing lots of little drags.
Sorry I can't provide much more then that
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With