0

I'm testing a native Android app and would like to be able to swipe left or swipe right on an element. I have read the documentation here:

https://codecept.io/helpers/Appium.html#swiperight

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeRight(locator); // simple swipe
I.swipeRight(locator, 500); // set speed
I.swipeRight(locator, 1200, 1000); // set offset and speed

I can't get it working though. I'm pretty sure I have the right locator as when I do an I.tap(locator), it works.

Has anyone managed to get I.swipeRight(locator) or I.swipeLeft(localtor) working?

Scott Deagan
  • 331
  • 3
  • 8

1 Answers1

1

I ran into the same issue. I'm doing this on iOS instead of Android but what ended up working for me was

I.executeScript('mobile: swipe', {direction: 'left'})

For other options—which may be platform-specific—you'll probably want to look at Appium docs (not specific to CodeceptJS).

timmcliu
  • 1,769
  • 1
  • 13
  • 12