@Test
public static void swipe() throws InterruptedException {
//Thread.sleep(4000);
TimeUnit.SECONDS.sleep(1);
JavascriptExecutor js = (JavascriptExecutor) web123;
HashMap swipeObj = new HashMap();
swipeObj.put("startX", 100.0);
swipeObj.put("startY", 80.0);
swipeObj.put("endX", 100.0);
swipeObj.put("endY", 350.0);
swipeObj.put("duration", 2.0);
// 拖动
for (int i = 0; i < 6; i++) {
js.executeScript("mobile: swipe", swipeObj);

}
TimeUnit.SECONDS.sleep(1);
}

我在坛子里找到的一段完成滑动操作的代码,但是运行程序没有执行滑动操作,求大神们帮解决一下


↙↙↙阅读原文可查看相关链接,并与作者交流