SeeTestAutomation - GetTextIn
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
GetTextIn**(**Zone, Element, Index, Text Zone, Direction, Width, Height)
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.
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
Step 3: In the script area type in the command "GetTextIn" and fill up the following properties.
Result:
Code Examples
Java Example
String str0 = client.getTextIn("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);
C# Example Expand source
string str0 = client.GetTextIn("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);
VBScript Example Expand source
str0=client.GetTextIn("NATIVE","accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0 )
Report
Python Example Expand source
var0 = self.client.getTextIn2("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0)
Perl Example Expand source
my $str0 = $client->getTextIn2("NATIVE", "accessibilityLabel=makePaymentButton", 0, "WEB", "Up", 0, 0);