GetTextIn
Description
Get text in a certain area relative to an element . The direction can be UP, DOWN, LEFT or RIGHT.
Parameters
Name | Value | Description |
---|---|---|
Zone | String with one of the following values * NATIVE * WEB * TEXT | Zones which define the way the element will be identified. |
Element | String | Select an Element |
Index | Integer | Element index |
Text Zone | String with one of the following values * NATIVE * WEB * TEXT | The zone to extract the text from. See getText command for the options. |
Direction | String | Direction to analyze - can be UP, Down, Left, Right or Inside |
Width | Integer | Width of the search |
Height | Integer | Height of the search |
Usage
Command can be used to get text for certain area.
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
In this example we will try to get all the text of the Web part from the EriBank Application.
Login to Eribank Application to get following screen
Using Object Spy find the Xpath corresponding to the "MakePayment". Use the code snippet below to use this command to get the text.
GetTextln
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");
...
...
String str0 = client.getTextIn("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);