Silk Mobile

Table of Contents (Homepage)

ElementGetTableRowsCount

ElementGetTableRowsCount(Zond, TableLocator, TableIndex, Visible)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

Description

This command allows you to extract the numbers of one or more rows of a given table, whether the table is entirely visible on the screen or not.

Parameters

  • Zone - Select the Zone in which the table is stored. If you set the value of the Zone to "default" or to some user-defined Zone name, the row numbers can be extracted from a table stored in Silk Mobile’s repository.

  • TableLocator - Locator of the table class element

  • TableIndex - Index in case of multiple tables on the screen

  • Visible - Boolean parameter. Set true to return the number of visible rows only, or false to return the total number of rows including ones that are not visible.

Usage

Scenario: In the following example we will extract the number of rows in the main menu table of the UIcatalog application.

images/download/attachments/2689449/4.jpg

Parameters:

  • TableLocator - Table class locator - will be set to xpath=//*[@class='UITableView']

  • TableIndex - Table index - will be set to 0

  • Visible - Boolean parameter

Command Results:

  • With Visible set to True - the command will return 12, which is the number of rows visible on the screen.

  • With Visible set to False - the command will return 14, since there are 2 more rows that are not visible and will only show after a scroll down.

Code Examples

Java Example
int int3 = client.elementGetTableRowsCount("NATIVE", "xpath=//*[@class='UITableView']", 0, true);
C# Example
int int3 = client.ElementGetTableRowsCount("NATIVE", "xpath=//*[@class='UITableView']", 0, true);
VBScript Example
int7 = client.ElementGetTableRowsCount ( "NATIVE", "xpath=//*[@class='UITableView']", 0, true )
Report
Python Example
var3 = self.client.elementGetTableRowsCount("NATIVE", "xpath=//*[@class='UITableView']", 0, True)
Perl Example
my $int3 = $client->elementGetTableRowsCount("NATIVE", "xpath=//*[\@class='UITableView']", 0, 1);