Skip to main content

SeeTestAutomation - GetElementCount

info

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 .

**GetElementCount (**Zone, Element)



Description

Count the number of times an element or text is found.

Parameters

Usage

Scenario: In the following example we will check how many tiles there are on the current screen of the device.

Step 1: We will look for a common property for all the tiles.

In this case will be set to "xpath=//*[@class='android.widget.TextView']"

Step 2: We will use the getElementCount command to count number of tiles on the screen.

Parameters:

  • Zone: Select Zone
  •  Element: "xpath=//*[@class='android.widget.TextView']"

Code Examples

Java Example

int int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']");

C# Example Expand source

int int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']");

VBScript Example Expand source

int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']")
Report

Python Example Expand source

ar2 = self.client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView'] ")

Perl Example Expand source

my $int2 = $client->getElementCount("NATIVE", "xpath=//*[\@class='android.widget.TextView'] ");