Skip to content

How do I swipe based on the coordinates in mobile apps

This example demonstrates how to swipe based on the X and Y coordinates. Two sets of coordinates should be provided, the first being the starting position and the second, being the ending (from and to).

In the solution shown below, you will see that we are swiping on the PDF pages screen in the HICC application using the "swipe" command by providing the coordinate values in the "Target" field.

Solution:

# Command Target Value
Swipe the pages from the first page to the second page in PDF. First two are 'from' and second two are 'to'.
1 swipe 280,710,280,171

Note: The coordinates differ depending on the resolution of the device.

Tips, Tricks, Gotchas & Best Practices:

  • the above-mentioned command fails to perform the swipe action then you can use the scrollToView command with the text "Horizontal / Vertical" in the value field.
  • As a best practice, you are encouraged to validate the visibility of any element that is expected to be displayed after the tap action using assertVisible, verifyVisible or waitForVisible commands.

Feedback and Knowledge Base