如何使用Android UI Automator进行DoubleTap

时间:2014-03-27 11:46:35

标签: android uiautomator

我正在尝试使用Android UI Automator工具双击视图,但没有可以双击的API。有没有其他方法可以使用ui automator双击。

提前致谢。

1 个答案:

答案 0 :(得分:0)

Gesture interaction with the device
Click on the screen

d.click(x, y)
Double click

d.double_click(x, y)
d.double_click(x, y, 0.1) # default duration between two click is 0.1s
Long click on the screen

d.long_click(x, y)
d.long_click(x, y, 0.5) # long click 0.5s (default)
Swipe

d.swipe(sx, sy, ex, ey)
d.swipe(sx, sy, ex, ey, 0.5) # swipe for 0.5s(default)

d.drag(sx, sy, ex, ey)
d.drag(sx, sy, ex, ey, 0.5) # swipe for 0.5s(default)
Swipe points

# swipe from point(x0, y0) to point(x1, y1) then to point(x2, y2)
# time will speed 0.2s bwtween two points
d.swipe_points([(x0, y0), (x1, y1), (x2, y2)], 0.2))