Description
Count the number of times an element or text is found.
Parameters
Name | Value | Description |
---|---|---|
Zone |
| 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.
Set Experitest Url
Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.
- For SeeTest cloud, EXPERITEST_URL needs to be https://cloud.seetest.io:443/wd/hub
- For Dedicated Experitest Lab, EXPERITEST_URL needs to be your own domain. e.g - https://company.experitest.com
Example
GetElementCount
DesiredCapabilities dc = new DesiredCapabilities(); driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), 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']");