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的作用是在多少毫秒内进行滑动操作

转载于:https://www.cnblogs.com/lxs1314/p/7193395.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值