SeeTestAutomation - Swipe
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Description
Swipe the screen in a given direction
Parameters
SeeTestAutomation - Direction: Direction of the swipe motion.
SeeTestAutomation - Offset: Swipe offset (in pixels).
Time: Overall swipe time
Usage
To swipe the screen, you can add the command 'Swipe', provide the direction, offset and action time.
As a visible aid, an arrow will be drawn on the reflection showing the swipe motion. It will start according the swipe value and will point the opposite of the swipe direction.
For example, for the Right direction, the swipe arrow will point to the Left.
Example
Scenario: In the following example, we will swipe to the screen to the right in order to get to an application.
Parameters:
- Direction: Direction to swipe – will be set to RIGHT
- Offset: Swipe offset – will be set to 20 (more then 0) so it will not start from the reflection border.
- Time: Swipe overall time – will be set to 500
Code Examples
Java Example
client.swipe("Right", 20, 500);
C# Example Expand source
client.Swipe("Right", 20, 500);
VBScript Expand source
client.Swipe "Right", 20, 500
Python Example Expand source
self.client.swipe2("Right", 20, 500)
Perl Example Expand source
$client->swipe2("Right", 20, 500);
iOS 15 and Above
In some cases the swipe operation might require to use SetDragStartDelay first.
Example use-cases:
- Opening control-center on devices with home button via swipe down.
- Opening app-switcher on devices without home button via swipe down.
Java Example
client.setDragStartDelay(50);
client.swipe("Down", 0, 2000);