How to perfrom Long press operation in Andriod devices?
Posted on April 3, 2019
By Shibu Panda
Code Snippet:
//Appium Version: 1.12.0
//Java-Client:7.0.0
MobileElement webElement=driver.findElement(By.xpath("//android.widget.RelativeLayout[@resource-id='com.fortysevendeg.android.swipelistview:id/front']"));
LongPressOptions longPressOptions = new LongPressOptions();
longPressOptions.withDuration(Duration.ofSeconds(4)).withElement(ElementOption.element(webElement));
new TouchAction(driver).longPress(longPressOptions).perform();