Swipe action on the captured object

Hi community members!

Im trying to do a swipe action for a button to proceed with the next steps. How can i swipe on the exact captured “Swipe to confirm” button? I’ve tried to use the Mobile.getDeviceHeight() & Mobile.getDeviceWidth() but still unable to detect that button at the bottom of the page and will have error

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Hi @Newtest0101,

Can you try scroll to text? [Mobile] Scroll To Text | Katalon Docs

Hi,
For this case, cannot use the scroll to text because the object [swipe to confirm button] can be captured easily. I just need to do swipe action (From left to right) to confirm the activity on the captured object but cannot find this solution

Is there any solution for this or Katalon doesn’t provide this action at this moment?

It is difficult to know exactly what your app structure looks like but you should be able to detect the object that needs to be swiped. Then you can utilize the functions for getElementLeftPosition, getElementTopPosition, and getElementWidth. This in code might look like:

int startx = Mobile.getElementLeftPosition(findTestObject('<Swipe to confirm object>'), 5)
int endx = startx + Mobile.getElementLeftPosition(findTestObject('<Swipe to confirm object>'), 5)
int y = Mobile.getElementTopPosition(findTestObject('<Swipe to confirm object>'), 5)

Mobile.swipe(startx, y, endx, y)