Swipe Mobile Screen
Command description
Swipe from one point to another on the mobile screen. The upper-left corner is (0, 0), and the lower-right corner is (screen width, screen height).
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Mobile Device Object | Phone | Connected mobile object |
| Start X Coordinate | int or str | Starting X coordinate |
| Start Y Coordinate | int or str | Starting Y coordinate |
| End X Coordinate | int or str | Ending X coordinate |
| End Y Coordinate | int or str | Ending Y coordinate |
| Swipe Duration | number | Time to swipe from the starting point to the ending point, in seconds |
Command Output Parameters
None
Type definition reference
Coordinates and duration description
- All coordinates are based on the upper left corner of the phone screen as the origin
- If you have obtained the element object, you can directly use
phoneElement.x_centerandphoneElement.y_centeras the starting point or end point - A longer Swipe Duration produces a slower swipe. Use a shorter duration when the page needs inertial scrolling.
Example
Swipe to load more contacts
tip
Enable Developer options on the mobile device, then connect it to the computer with a USB cable. See Connect Mobile Device