appium的webdriver执行swipe

 1 # convenience method added to Appium (NOT Selenium 3)
 2     def swipe(self, start_x, start_y, end_x, end_y, duration=None):
 3         """Swipe from one point to another point, for an optional duration.
 4  
 5         :Args:
 6          - start_x - x-coordinate at which to start
 7          - start_y - y-coordinate at which to start
 8          - end_x - x-coordinate at which to stop
 9          - end_y - y-coordinate at which to stop
10          - duration - (optional) time to take the swipe, in ms.
11  
12         :Usage:
13             driver.swipe(100, 100, 100, 400)
14         """

从以上源码来看,再结合self.driver.swipe(x1,y1,x2,y1,t)这个来看,以上源码并没有对最后一个参数t做解释

故这样用的话 代码执行后其实并没有实现滑动的效果,所以我们一般要设置t时间为多少ms

最后一个参数t的作用是在多少毫秒内进行滑动操作

posted @ 2017-07-17 11:14  彩笔杀手  阅读(1512)  评论(0编辑  收藏  举报