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

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -