android - Long press on a view using AndroidViewClient -
how can simulate long press on view (for example button) using androidviewclient? touch method of viewclient
performs simple press on input (even if set type argument adbclient.down)
edit: touch method in adbclient.py
has type argument, not used in method body. in monkeyrunner
, when type down, performs longpress.
def touch(self, x, y, eventtype=down_and_up): self.shell('input tap %d %d' % (x, y))
i find answer question right now. can use drag method simulate long pressing on views. sample code follow:
buttontext = 'clme' button = vc.findviewwithtext(buttontext ) (x,y) = button.getxy() button.device.drag((x,y), (x,y), 2000, 1)
Comments
Post a Comment