Skip to main content

GetElementCountIn

Description

Count the number of elements appearances in a container.

Parameters

NameValueDescription
ZoneString with one of the following values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
Element SearchStringSearch Element
IndexIntegerElement index
DirectionStringDirection to analyze. The options are UP, Down, Left, Right or Inside
Element Count ZoneString with one of the following values



* NATIVE

* WEB

* TEXT
The zone to extract the text from
Element CountIntegerSelect Element to count
WidthIntegerWidth of the search
HeightIntegerHeight of the search

Usage

Similar command to getElementCount command which will count elements based on a container.

info

Replace <server> with the appropriate URL.

Example

Following example we count number of buttons in the application below.

**

**

GetElementCountIn

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

...
...
int int0 = seetest.getElementCountIn("NATIVE", "//*[@id='scrollView1']", 0, "Inside", "NATIVE", "class=android.widget.Button", 0, 0);