Question

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

Was it helpful?

Solution

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top