Silk Mobile

Table of Contents (Homepage)

GetText

String GetText(Zone)

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

Get all text by a specific Zone from entire screen of the device reflection.

Parameters

  • Zone: Select a Zone to get all text from.

  • NATIVE: All text properties of the Native dump on the screen

  • WEB: All text properties of the Web dump on the screen

  • TEXT: it will get you all the text that appears on the screen.

  • Default (or another grouping zone name): All names of elements which are on the Object repository that appear on the screen in the chosen zone.

Usage

Zone Native

Will retrieve all the text properties of Native objects on the screen of the device on instrumented native applications or non-instrumented mode.

Note: Text properties will not be retrieved for elements which doesn’t have text property on the object spy.

Scenario: In the following example we will use getText with zone NATIVE on the login screen of ebay application.

images/download/attachments/3309864/1.jpg

Zone Web

Command usage: Will retrieve all the text properties of Web objects on the screen of the device on instrumented hybrid applications or Mobile web sites .

Note: Text properties will not be retrieved for elements which doesn’t have text property on the object spy

Scenario: In the following example we will use getText with zone WEB on the cnn web page.

images/download/attachments/3309864/2.jpg

Code Examples

Java Example
String str = client.getText("NATIVE")
C# Example
String str = client.GetText("NATIVE")
VBScript Example
str = client.GetText("NATIVE")
Python Example
var0 = self.client.getText("NATIVE")
Perl Example
my $str0 = $client->getText("NATIVE")