TouchAction is not working in appium | Appium Forum
M
MANISH KUMAR Posted on 20/07/2019

I have followed Video Session 7 for Appium and i have used same code for TouchAction but code is not working,

Can you please take look what i am missing..

Screenshot: https://www.screencast.com/t/srFhVMku1kOh

List<MobileElement> allMobileElement=driver.findElements(By.id("com.mobeta.android.demodslv:id/text"));
System.out.println("All Element are: "+allMobileElement.size());

MobileElement e1=allMobileElement.get(0);
MobileElement e2=allMobileElement.get(3);
System.out.println("Mobile Element e1 Text is: "+e1.getText());
System.out.println("Mobile Element e2 text is: "+e2.getText());

TouchAction action=new TouchAction(driver);

action.longPress(LongPressOptions().withElement(element(e1)).withDuration(ofSeconds(5))).moveTo(element(e2)).release().perform();

Please see the screenshot for more clearity.


M
MANISH KUMAR Replied on 21/07/2019

I have added static import now its working..