Silk Mobile

Table of Contents (Homepage)

GetTextIn

GetTextIn ( Zone, Element, Index, Text Zone, Direction, Width, Height)

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

Matching command to getText command . Get text in a certain area relative to an element . The direction can be UP, DOWN, LEFT or RIGHT.

Parameters

  • Zone: Select Zone

  • Element: Select an Element

  • Index: Element index

  • Text Zone: The zone to extract the text from. See getText command for the options.

  • Direction: Direction to analyze - can be UP, Down, Left, Right or Inside (to get the text inside the element).

  • Width: Width of the search ("0" indicates until the end/start of the window)

  • Height: Height of the search ("0" indicates until the end/start of the window)

Usage

In this example we will try to get all the text of the Web part from the EriBank Application

Step 1: Login and navigate to the Make Payment page.

images/download/attachments/2689438/1.jpg

Step 2: Now we want to extract the text of balance and we want to make sure it is above the “Make Payment” button. We will use the button as the element to search

images/download/attachments/2689438/2.jpg

Step 3: In the script area type in the command “GetTextIn” and fill up the following properties.

images/download/attachments/2689438/3.jpg

Result:

images/download/attachments/2689438/4.jpg

Code Examples

Java Example
String str0 = client.getTextIn("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);
C# Example
string str0 = client.GetTextIn("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);
VBScript Example
str0=client.GetTextIn("NATIVE","accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0 )
Report
Python Example
var0 = self.client.getTextIn2("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0)
Perl Example
my $str0 = $client->getTextIn2("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);