I need to a button for a few secs and , I have the following code,

WebElement recordButton = driver.findElement(By.id("xxxxxx/record_button"));
        TouchActions action = new TouchActions(driver);
        action.longPress(recordButton);
        action.release();
        action.perform();

I get the below errors

java.lang.ClassCastException:
io..java_client.android.AndroidDriver cannot be cast to
org.openqa.selenium.interactions.HasTouchScreen

What I’m I doing wrong.



Source link https://sqa.stackexchange.com/questions/35105/long-press-and-release-in-appium

LEAVE A REPLY

Please enter your comment!
Please enter your name here