Silk Mobile

Table of Contents (Homepage)

ClickIn

void clickIn (zone, searchElement, index, direction, clickElementZone, clickElement, clickElementIndex, width, height, clickCount)

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

Search for an element and click on another element in reference to it.

Parameters

  • Zone: Select Zone

  • Element: Select Element

  • Index: Selected Element index

  • Direction: Direction to analyze - DOWN, UP, LEFT, RIGHT, INSIDE

  • ClickElementZone: Select the Zone for the Element to click

  • ClickElement: Select the Element to click

  • clickElementIndex: Selected element to click index

  • Width: Width of the search in pixels ("0" indicating until the end/start of the window)

  • Height: Height of the search in pixels ("0" indicating until the end/start of the window)

  • clickCount: Number of clicks

Usage

When cannot identify the element to click directly, you can use another element as a reference.

Scenario: In the following example we will click the switch next to the "Bluetooth" label.

images/download/attachments/2689294/1.jpg

Parameters:

  • Zone: set to be "NATIVE"

  • SearchElement: set to "xpath=//*[@text='Bluetooth']"

  • Index: set to "0"

  • Direction: set to "Right"

  • ClickElementZone: set to "NATIVE"

  • ClickElement: set to "xpath=//*[@class='android.widget.Switch']"

  • ClickElementIndex: set to "0"

  • Width: set to "0"

  • Height: set to "0"

  • ClickCount: set to “1”

Result:

Value of the switch is now on.

images/download/attachments/2689294/2.jpg

Code Examples

Java Example
client.clickIn("NATIVE", "xpath=//*[@text='Bluetooth']", 0, "Right", "NATIVE", xpath=//*[@class='android.widget.Switch']", 0, 0, 0, 1);
C# Example
client.ClickIn("NATIVE", "xpath=//*[@text='Bluetooth']", 0, "Right", "NATIVE", "xpath=//*[@class='android.widget.Switch']", 0, 0, 0, 1);
VBScript Example
client.ClickIn "NATIVE", "xpath=//*[@text='Bluetooth']", 0, "Right", "NATIVE", "xpath=//*[@class='android.widget.Switch']", 0, 0, 0, 1
Report
Python Example
self.client.clickIn3("NATIVE", "xpath=//*[@text='Bluetooth']", 0, "Right", "NATIVE", "xpath=//*[@class='android.widget.Switch']", 0, 0, 0, 1)
Perl Example
$client->clickIn3("NATIVE", "xpath=//*[@text='Bluetooth']", 0, "Right", "NATIVE", "xpath=//*[@class='android.widget.Switch']", 0, 0, 0, 1);