How to scroll android screen by AndroidViewClient

442 views Asked by At

Currently, I'm working on Snapchat and I want to scroll the screen slightly

1.device.vc.dump()
2.device.vc.findViewByIdOrRaise("com.snapchat.android:id/neon_header_avatar_container").touch()
3.device.vc.dump()

Now I want to scroll the screen to findViewWithText My friends. so how I can do it,

1

There are 1 answers

3
Diego Torres Milano On

You can use culebra and generate the python code needed for scrolling or dragging.

Run

culebra -Gu --scale=0.25

then right-click and open the command dialog, select Drag dialog and grab the points clicking on the device image (using Settings here as an example)

enter image description here

something like the following code will be generated

device.dragDip((184.73, 699.64), (176.0, 443.64), 1000, 20, 0)
vc.sleep(1)
vc.dump(window=-1)

When executed you will see the device scrolling.