Skip to main content

ElementGetText

Description

Use this command to get text from an element. The text is returned as a string.

Parameters

NameValueDescription
ZoneString with following possible values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementString which identifies the ElementIdentification of Element in the device screen.



Example: Button, Text Box.
indexIntegerInteger representing index of the element.

Usage

info

Replace <server> with the appropriate URL.

ElementGetText

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");

...
...
// Command will fetch the "enabled" property of Element "Contacts" if the Android Contacts App is opened and
// displayed in the Device screen
String text = seetest.elementGetText("NATIVE", "//*[@text='Hint:company']", 0);