• app自动化之手势(九宫格)滑动解锁


    1.手势解锁如何取做呢,如下是整体一个空间,无法使用定位,只能使用坐标取定位

    脚本如下:

     @Test
     public void testMultiSwipe() {
      // 实例化TouchAction对象
      TouchAction touchAction = new TouchAction<>(androidDriver);
      // 把原始的时间转换成Duration类型的
      Duration duration = Duration.ofMillis(800);
      // 把Duration类型转换为waitOptions类型
      WaitOptions waitOptions = WaitOptions.waitOptions(duration);
      // 把原始坐标转换成PointOption类型的
      PointOption pointOption1 = PointOption.point(150,427);
      PointOption pointOption2 = PointOption.point(362,427);
      PointOption pointOption3 = PointOption.point(569,427);
      PointOption pointOption4 = PointOption.point(359,625);
      PointOption pointOption5 = PointOption.point(150,850);
      PointOption pointOption6 = PointOption.point(362,850);
      PointOption pointOption7 = PointOption.point(569,850);
      touchAction.longPress(pointOption1).moveTo(pointOption2).moveTo(pointOption3).moveTo(pointOption4).moveTo(pointOption5).moveTo(pointOption6).moveTo(pointOption7).release();
      
      // 让滑动生效
      touchAction.perform();
     }

  • 相关阅读:
    Python 魔术方法
    Python 类和对象-上
    Python 日期时间相关
    Python OS模块
    Python文件操作
    Python集合操作
    Python字典操作
    为什么最小帧长度是64字节
    字典_ 三级菜单
    cart_购物车小程序
  • 原文地址:https://www.cnblogs.com/JacquelineQA/p/12449817.html
Copyright © 2020-2023  润新知