Silk Mobile

Table of Contents (Homepage)

ElementSwipe

ElementSwipe (Zone, Element, Index, Direction, Offset, Time)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

images/images/os-icons/os_blackberry_150x150.png

images/images/os-icons/os_symbian02_150x150.png

images/images/os-icons/os_windows_mobile_150x150.png

Description

Swipe the screen in a given direction. The command will only perform the swipe within a given container.

Parameters

  • Zone: Select Zone

  • Element: Select Element

  • Index: Element index

  • Direction: Direction to swipe

  • Offset: Swipe offset

  • Time: Swipe overall time (milliseconds)

Usage

Command usage: Equivalent command to the swipe command. This command will swipe inside a container and not the entire screen.

Scenario:

We will use the Amazon application to swipe the menu down.

Note that the menu doesn’t hold on the entire screen so on different devices, we may get different behavior.

Parameters:

  • Zone: will be set to "NATIVE"

  • Element: will be set to "id=browse_menu"

  • Index: will be set to "0"

  • Direction: will be set to "DOWN"

  • Offset: will be set to "500"

  • Time: will be set to "1000"

images/download/attachments/2689151/1.jpg images/download/attachments/2689151/2.jpg

Code Examples

Java Example
client.elementSwipe("NATIVE", "id=browse_menu", 0, "Down", 500, 1000);
C# Example
client.ElementSwipe("NATIVE", "id=browse_menu", 0, "Down", 500, 1000);
VBScript Example
client.ElementSwipe "NATIVE", "id=browse_menu", 0, "Down", 500, 1000
Report
Python Example
self.client.elementSwipe("NATIVE", "id=browse_menu", 0, "Down", 500, 1000)
Perl Example
$client->elementSwipe("NATIVE", "id=browse_menu", 0, "Down", 500, 1000);