Silk Mobile

Table of Contents (Homepage)

LongClick

void longClick (Zone, Element, Index, ClickCount, X, Y)

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

Long click on or near an element or text (the proximity to the element/text is specified by an X-Y offset)

Parameters

  • Zone: Select Zone

  • Element: Select Element

  • Index: Element Index

  • Click Count: Number of Clicks

  • X: Horizontal Offset from the Element in screen pixels (can use P2cx to convert screen percentage to pixels)

  • Y: Vertical Offset from the Element in screen pixels (can use P2cy to convert screen percentage to pixels)

Usage

Designed command for longer click operations (click duration is 2000 milliseconds)

Scenario: In the following example we will use the longClick command to press the "EriBank" icon on iOS springboard in order to delete/move it.

Parameters:

  • Zone: Set to be Native (using the non instrumentation feature - link)

  • Element: Query: xpath=//*[@text='EriBank']

  • Index: Set to be 0

  • Click count: Set to be 1

  • X: Set to 0

  • Y: Set to 0 p>

images/download/attachments/2689267/1.jpg

Code Examples

Java Example
client.longClick("default", "EriBank", 0, 1, 0, 0);
C# Example
client.LongClick("default", "EriBank", 0, 1, 0, 0);
VBScript Example
client.LongClick "default", "EriBank", 0, 1, 0, 0
Report
Python Example
self.client.longClick("default", "EriBank", 0, 1, 0, 0)
Perl Example
$client->longClick("default", "EriBank", 0, 1, 0, 0);