TouchAction for Appium is not working

Viewed 1197

A new guy to mobile automation here.. I am trying the below code using Touch Action to perform the swipe action to navigate to page 2, but swipe is not functioning.

AndroidDriver driver=new AndroidDriver<>(url,cap);
TouchAction ta=new TouchAction(driver);
ta.press(565,372).moveTo(-381,-6).release().perform();

everything else works fine. As the swipe is not functioning, I get the same content retrieved for both pages. Please correct me what is wrong?

1 Answers

Have you attempted giving your .moveTo absolute values as opposed to relative? I've seen inconsistencies with how that's been handled, but can't recall the exact details. It was something with certain versions of things and certain operating systems. Easier to give it a shot than work through all your versions of everything.

In your case you'd want to try .moveTo(184, 366)

Another idea would be to include a waitAction(time) between the press and move.

Related