SeeTestAutomation - GetElementCountIn
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 .
int getElementCountIn(zoneName, elementSearch, index, direction, elementCountZone, elementCount, width, height)
Description
Count the number of elements appearances in a container.
Parameters
- SeeTestAutomation - Zone: Select Zone of container
- Element Search: Select the Element container
- Index: Element index
- Direction: Direction to analyze. The options are UP, Down, Left, Right or Inside
- Element Count Zone: The zone to extract the text from
- Element Count: Select Element to count
- 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
Similar command to getElementCount command which will count elements based on a container.
Scenario: In the following example we will count the number of buttons on the EriBank home screen.
Parameters:
- Zone: set to be NATIVE
- Element Search: set to be xpath=//*[@id='scrollView1']
- Index: set to be 0
- Direction: set to be Inside
- Element Count Zone: set to be NATIVE
- Element Count: set to be class=android.widget.Button
- Width: set to be 0
- Height: set to be 0
Result: Upon execution of this command, we will be able to see the count as 4.
Code Examples
Java Example
int int0 = client.getElementCountIn("NATIVE", "xpath=//*[@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0);
C# Example Expand source
int int0 = client.GetElementCountIn("NATIVE", "xpath=//*[@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0);
VBScript Example Expand source
int0 = client.GetElementCountIn ( "NATIVE", "xpath=//*[@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0 )
Report
Python Example Expand source
var0 = self.client.getElementCountIn("NATIVE", "xpath=//*[@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0)
Perl Example Expand source
my $int0 = $client->getElementCountIn("NATIVE", "xpath=//*[\@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0);