Frage

I am looking forward to scroll a list with the help of Android view client(dtmilano) .The list has 109 elements and only 10 are visible. So i need to scroll down and again perform vc.dump . Kindly guide with a sample python code to perform scroll down operation. Thanks

War es hilfreich?

Lösung

You should use MonkeyDevice.drag() and your script would look something like this

list = vc.findViewByIdOrRaise(someid)
(x, y, w, h) = list.getPositionAndSize()
start = (int(x+w/2.0), y+h)
end = (int(x+w/2.0), y)
# scroll 5 times
for i in range(5):
    vc.device.drag(start, end, 1.0, 10)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top