我已尝试在android中实现swipe方法,但此方法不能满足我的要求。 下面我写的代码
public void swipe()
{
System.out.println("<<< Javascript driver >>>");
JavascriptExecutor js = (JavascriptExecutor) driver;
System.out.println("<<< HashMap >>>");
HashMap<String, Double> swipeObject = new HashMap<String, Double>();
System.out.println("<<< Collects start X values >>>");
swipeObject.put("startX", 0.95);
System.out.println("<<< Collects start Y values >>>");
swipeObject.put("startY", 0.5);
System.out.println("<<< Collects end X values >>>");
swipeObject.put("endX", 0.05);
System.out.println("<<< Collects end Y values >>>");
swipeObject.put("endY", 0.5);
System.out.println("<<< Duration >>>");
swipeObject.put("duration", 1.0);
System.out.println("<<< Swipe object >>>");
js.executeScript("emulator: swipe", swipeObject);
System.out.println("<<< Swipe object completed>>>");
}
任何人都可以帮助解决这个问题。 提前致谢