HELP: Mobile.swipe(startx,starty,endx,endy)

I am new to automation and using Katalon. I am currently trying to automate swipe gesture. The object contains 4 slides. I tried the code below but both swipes from Left side to Right side:

int startX = (int)(Mobile.getDeviceWidth()*0.70) //start point is on the ride side of the screen
int endX = (int)(Mobile.getDeviceWidth()*0.30) //end point is on the left side of the screen
int startY = Mobile.getDeviceHeight()/2 //Middle of the screen

Mobile.swipe(startX,startY,endX,startY) //supposedly Right to Left
Mobile.swipe(endX,startY,startX,startY) //Left to Right

Is there other approach in order to automate swipe from left to right?

I’m having a similar issue with automating the app to scroll up or down.

Any info would be much appreciated

it’s using relative position to the starting position now.
you need to do something like

Mobile.swipe(startX,startY, -500, 0) 

to swipe left.

Refer to

1 Like

This might help :