zoukankan      html  css  js  c++  java
  • 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的作用是在多少毫秒内进行滑动操作

  • 相关阅读:
    C# fields Study
    单词1
    C# Base Class Study
    C# Type Parameters Study
    C#3.0学习系列类的成员
    美国式教育
    单词2
    项目添加Struts2支持,并修改默认后缀
    Java多线程的学习和应用
    SQL PIVOT
  • 原文地址:https://www.cnblogs.com/lxs1314/p/7193395.html
Copyright © 2011-2022 走看看