zoukankan      html  css  js  c++  java
  • 一些滑动操作

    uiautomator滑动
    1.滑动到最左侧
    device(scrollable=True).scroll.horiz.toBeginnng()
    
    2.滑动到最右侧
    device(scrollable=True).scroll.horiz.toEnd()
    
    3.滑动到屏幕底部
    device(scrollable=True).scroll.toEnd()
    
    4.滑动到屏幕顶部
    device(scrollable=True).scroll.toBeginnng()
    
    5.垂直滑动到指定元素出现
    device(scrollable=True).scroll.to(description)
    如:device(scrollable=True).scroll.to(text='立新二手车') 滑动到text=立新二手车的元素出现
    
    6.水平滑动到指定元素出现
    device(scrollable=True).scroll.horiz.to(description)
    
    7.forward()垂直滑动 同scroll
    device(scrollable=True).scroll.forward() 同 device(scrollable=True).scroll.toBeginnng()
    device(scrollable=True).scroll.forward.to(description) 同 device(scrollable=True).scroll.to(description)
    
    8.拖动指定元素到另一个元素的位置
    d(text="一口价").drag_to(text="询价", duration=2)
    
    9.拖动指定元素到指定位置(比如拖动到屏幕中间)
    d(text="一口价").drag_to(0.5,0.5, duration=2)
    
    selenium中滑动到某个元素出现
    target=driver.find_element_by_id('id')
    driver.execute_script("arguments[0].scrollIntoView();", target)
    
    
  • 相关阅读:
    java反射小练习
    Set与list测试
    关于用户界面
    自定义标签打包使用问题
    jsp中获取当前访问路径
    LeetCode 汇总
    LeetCode 46. 全排列
    LeetCode 40.组合总和II
    LeetCode 39.组合总和
    LeetCode 37.解数独
  • 原文地址:https://www.cnblogs.com/alantammm/p/13203525.html
Copyright © 2011-2022 走看看