Page tree
Skip to end of metadata
Go to start of metadata

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.
ElementString 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.

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']");



  • No labels