GetElementCount ( Zone, Element)
|
|
|
|
|
|
|
Count the number of times an element or text is found.
Scenario: In the following example we will check how many tiles there are on the current screen of the device.
Step 1: We will look for a common property for all the tiles.
In this case will be set to “xpath=//*[@class='android.widget.TextView']”
Step 2: We will use the getElementCount command to count number of tiles on the screen.
Parameters:
Zone: Select Zone
Element: “xpath=//*[@class='android.widget.TextView']”
int int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']");int int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']");int0 = client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView']")Reportar2 = self.client.getElementCount("NATIVE", "xpath=//*[@class='android.widget.TextView'] ")my $int2 = $client->getElementCount("NATIVE", "xpath=//*[\@class='android.widget.TextView'] ");