public static AndroidDriver driver;
/长按操作:waitAction的参数单位是ms/
public static void longClick(String id){
WebElement longClick = driver.findElement(By.id(id));
new TouchAction(driver).longPress(longClick).waitAction(1000).perform();
}
/TouchAction.class中定义/
public TouchAction waitAction(int ms) {
TouchAction.ActionParameter action = new TouchAction.ActionParameter("wait");
action.addParameter("ms", Integer.valueOf(ms));
this.parameterBuilder.add(action);
return this;