wSectionCount Property (Specific to Xamarin.Forms TableView Controls)

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Use the wSectionCount property to get the total number of sections in the table view.

Declaration

TestObj.wSectionCount

Read-Only Property Integer
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

An integer value holding the total number of sections in the control.

Example

The following example gets the properties of all TableView items and posts them to the log:

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("MyMobileDevice");
  // Obtain the TableView object
  var p = Mobile.Device().Process("SampleApp");
  var tableview = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TableView");
  
  for (var i = 0; i < tableview.wSectionCount; i++)
  {
    Log.Message(tableview.wSection(i));
    Log.Message(tableview.wItemCount(i));
  }
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")
  # Obtain the TableView object 
  p = Mobile.Device().Process("SampleApp")
  tableview = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TableView")
  
  for i in range (0, tableview.wSectionCount):
    Log.Message(tableview.wSection[i])
    Log.Message(tableview.wItemCount[i])

VBScript

Sub Test()
  Dim p, tableview
  ' Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")
  ' Obtain the TableView object
  Set p = Mobile.Device.Process("SampleApp")
  Set tableview = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TableView")
  
  For i = 0 To tableview.wSectionCount - 1
    Log.Message(tableview.wSection(i))
    Log.Message(tableview.wItemCount(i))
  Next
End Sub

DelphiScript

procedure Test();
var
  p, tableview, i, n;
begin
  // Select the mobile device
  Mobile.SetCurrent('MyMobileDevice');
  // Obtain the tableview object
  p := Mobile.Device.Process('SampleApp');
  tableview := p.XFObject('MainPage', '').XFObject('Grid', '').XFObject('TableView');
  
  for i := 0 to tableview.wSectionCount - 1 do
  begin
    Log.Message(tableview.wSection(i));
    Log.Message(tableview.wItemCount(i));
  end;
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("MyMobileDevice");
  // Obtain the TableView object
  var p = Mobile["Device"].Process("SampleApp");
  var tableview = p["XFObject"]("MainPage", "")["XFObject"]("Grid", "")["XFObject"]("TableView");
  
  for (var i = 0; i<tableview["wSectionCount"]; i++)
  {
    Log["Message"](tableview["wSection"](i));
    Log["Message"](tableview["wItemCount"](i));
  }
}

See Also

wSection Property (Specific to Xamarin.Forms TableView Controls)
Xamarin.Forms Objects
List of Xamarin.Forms Controls

Highlight search results