美文网首页
uiautomator2 详解

uiautomator2 详解

作者: 你好_兔先生 | 来源:发表于2019-07-28 22:10 被阅读0次

    参考自:https://github.com/openatx/uiautomator2

    点击与滑动

    d(text='Via').click() 
    d(text='Via').click(timeout=10) #等10秒如果目标还不出现,报错吧
    d(text="Skip").click_gone(maxretry=10, interval=1.0)
    # maxretry default 10, interval default 1.0目前在的话,每隔1秒点一次,共点10次。
    d(text='Skip').click_exists(timeout=10.0)
     #存在10秒之后点击,默认是0秒(一出现就点)
    d.double_click(x, y, 0.1) #双击,默认每次间隔 0.1s
    d.long_click(x, y, 0.5) #长摁,默认0.5s
    d.swipe(sx, sy, ex, ey, 0.5) # 滑动,for 0.5s(default)
    d.drag(sx, sy, ex, ey, 0.5) #拖拽 for 0.5s(default)
    d.swipe((x0, y0), (x1, y1), (x2, y2), 0.2) #解锁屏,九宫格用
    

    相关文章

      网友评论

          本文标题:uiautomator2 详解

          本文链接:https://www.haomeiwen.com/subject/xelmrctx.html