How to perform scroll and flick with Appium for Android

3,322 views
Skip to first unread message

Lieping Xie

unread,
Sep 10, 2013, 2:50:27 AM9/10/13
to appium-...@googlegroups.com
Just using Appium 0.9.0 and Python on Windows for Android testing, most of the elements identification are working but scroll and flick is not.

When using scroll method in selenium.webdriver.common.touch_actions, the server gives the response that method is not implemented.
When using flick/flick_element method in selenium.webdriver.common.touch_actions, the server always gives the response that 'Flick did not complete successfully'

debug: Appium request initiated at /wd/hub/session/541163f6-5de3-43bc-9ffd-206bcad80a28/touch/flick
debug: Request received with params: {"sessionId":"541163f6-5de3-43bc-9ffd-206bcad80a28","element":"45","speed":100,"xoffset":0,"yoffset":5}
info: Pushing command to appium work queue: ["element:flick",{"xoffset":0,"yoffset":5,"speed":100,"elementId":"45"}]
info: [ADB] Sending command to android: {"cmd":"action","action":"element:flick","params":{"xoffset":0,"yoffset":5,"speed":100,"elementId":"45"}}
info: [ANDROID] [info] Got data from client: {"cmd":"action","action":"element:flick","params":{"xoffset":0,"yoffset":5,"speed":100,"elementId":"45"}}
info: [ANDROID] [info] Got command of type ACTION
info: [ANDROID] [debug] Got command action: flick
info: [ANDROID] [debug] Element bounds: [32,268][736,335]
info: [ANDROID] [info] Flicking from [x=384.0, y=301.5] to [x=384.0, y=306.5] with steps: 13
info: [ANDROID] [info] Returning result: {"value":"Flick did not complete successfully","status":13}
info: [ADB] Received command result from bootstrap
info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Flick did not complete successfully"},"sessionId":"541163f6-5de3-43bc-9ffd-206bcad80a28"}

Jonathan Lipps

unread,
Sep 10, 2013, 11:32:10 AM9/10/13
to Lieping Xie, appium-...@googlegroups.com
You'll want to use mobile: swipe and mobile: flick for now.


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

Nadya Alisawi

unread,
Mar 12, 2014, 1:41:22 PM3/12/14
to appium-...@googlegroups.com, Lieping Xie
Hello! I'm using    
driver.execute_script('mobile: flick', {'endX': '0.8', 'endY': '0.5'})
but getting the same problem:

debug: Appium request initiated at /wd/hub/session/9762c09c-217f-4ded-8ef5-a1fb3
97213d1/execute
debug: Request received with params: {"sessionId":"9762c09c-217f-4ded-8ef5-a1fb3
97213d1","args":[{"endY":"0.5","endX":"0.8"}],"script":"mobile: flick"}
info: Pushing command to appium work queue: ["swipe",{"startX":0.5,"startY":0.5,
"endX":"0.8","endY":"0.5","steps":6}]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"swipe",
"params":{"startX":0.5,"startY":0.5,"endX":"0.8","endY":"0.5","steps":6}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: swipe
info: [BOOTSTRAP] [info] Swiping from [x=360.0, y=640.0] to [x=576.0, y=640.0] w
ith steps: 6
info: [BOOTSTRAP] [info] Returning result: {"value":"The swipe did not complete
successfully","status":13}
info: Responding to client with error: {"status":13,"value":{"message":"An unkno
wn server-side error occurred while processing the command.","origValue":"The sw
ipe did not complete successfully"},"sessionId":"9762c09c-217f-4ded-8ef5-a1fb397
213d1"}
POST /wd/hub/session/9762c09c-217f-4ded-8ef5-a1fb397213d1/execute 500 691ms - 23
6b

Any help?

Nadya Alisawi

unread,
Mar 16, 2014, 3:31:56 AM3/16/14
to appium-...@googlegroups.com
well, like that you can avoid the error, the swipe works for me:
Swipe('0.1', '0.5') #to the left
def Swipe(endX, endY, startX = '0.5', startY = '0.5', duration = '0.5') : print 'Swiping...' try: driver.execute_script('mobile: swipe', {'duration': duration, 'startX': startX, 'startY': startY, 'endX': endX, 'endY': endY}) except: print 'There is still bug in Appium. But guest swipe should work.' sleep(1)

Dani

unread,
Jun 4, 2014, 12:42:30 PM6/4/14
to appium-...@googlegroups.com, fra...@gmail.com
Hi,

Can you please update this link you provided. It doesn't work now ...
Reply all
Reply to author
Forward
0 new messages