How to long press on android record button for a particular time in appium test, by java. I have tried 2 ways but both are not working at all, those are:
Way 1:
By pressRecBtn = By.id(“recorderButton”);
int x = 353; // x coordinate of device screen, get it after enabling the Show touch and Pointer location from developer option
int y = 980; // same as x
int timeInMs = 4000;
Action.longPress(driver.findElement(pressRecBtn)).longPress(x, y, timeInMs).perform();
Way2:
By pressRecBtn = By.id(“recorderButton”);
int timeInMs = 4000;
Action.longPress(driver.findElement(pressRecBtn)).waitAction(timeInMs).perform();
for this way its press on rec button but for a default time(>=1000 MS).