Skip to main content

GetElementCount

Description​

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

Parameters​

NameValueDescription
Zone* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementString which identifies the ElementCommon identifier to all the elements to count.

Usage​

Command can be used to get the count of element found in a screen.

info

Replace <server> with the appropriate URL.

Example

GetElementCount

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

...
...
// Counts the number of times element corresponding to //*[@class='android.widget.TextView'
int int0 = client.getElementCount("NATIVE", "//*[@class='android.widget.TextView']");