GetElementCount
Description
Count the number of times an element or text is found.
Parameters
Name | Value | Description |
---|---|---|
Zone | * NATIVE * WEB * TEXT | Zones which define the way the element will be identified. |
Element | String which identifies the Element | Common 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.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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']");