Appium TouchAction(long press) for 7 second

Hi,for Appium for Android. i use this lines for long press on elements:

//TouchAction class is used for long press on elements

TouchAction action1 = new TouchAction(driver);
String temp = SetUpGeneral.ApplicationPackage+":id/add_sound";
WebElement chat1 = driver.findElementById(temp);

Its work good.

the only problem is that i I need long press ( 7 Second ) on the element.
is it possible to set time for long prees ? (like prees for 7 second)

Thanks !

your longPress can receive the element and the duration of press:

action1.longPress(chat1, Duration.ofMillis(7000)).release().perform();

Thanks !!! :slight_smile:
you helped me alot :slight_smile:

It will also work:-;