I need to Long press one button, Is there any command for same

There is a button in application under test which need to hold for long time ~1min, but the script which generated from appium studio is showing one click on that button.
driver.findElement(By.xpath("//*[@id=‘Audio’]")).click();

any help would appreciated.

Hi,

You should work with the TouchAction interface

TouchAction action = new TouchAction(driver);
action.longPress(webElement).release().perform();

Thanks!
Its working fine now, i used below commands.

TouchAction action = new TouchAction(driver);
action.longPress(driver.findElement(By.xpath("//*[@id=‘homeBroadcast’]")), 20000).perform();

1 Like