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();
}