Skip to main content

Swipe

Description

Swipe the screen in a given direction.

Parameters

NameTypeDescription
DirectionStringDirection of the swipe motion.



* Right

* Left
OffsetIntegerSwipe offset
TimeIntegerSwipe overall time

Usage

Command can be used to swipe in a given direction from an offset.

info

Replace <server> with the appropriate URL.

swipe

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");

...
...
// Swipes right from an offset
seetest.swipe("Right", 10, 500);

iOS 15 and Above

In some cases the swipe operation might require you to use SetDragStartDelay first.

For example:

  • Opening control-center on devices with home button via swipe down.
  • Opening app-switcher on devices without home button via swipe down.

swipe

//Command to delay in drag.
seetest.setDragStartDelay(50);
// Swipes down from an offset
seetest.swipe("Down", 0, 2000);