wWheelCount Property (Specific to iOS Picker View Controls)

Applies to TestComplete 14.0, last modified on January 23, 2019

Description

Use the wWheelCount property to get the total number of wheels in the specified control.

Declaration

TestObj.wWheelCount

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

The total number of wheels in the control.

Remarks

You can use the wWheelCount, wItemCount and wItem properties to iterate through a control’s items.

Example

The following example iterates through picker view wheels and posts the items to the log.

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("iPhone");
  // Obtain the PickerView object
  var p = Mobile.Device().Process("SampleApp");
  var pickerview = p.Window(3).PickerView();
  
  for (var i=0; i<pickerview.wWheelCount; i++)
    for (var n=0; n<pickerview.wItemCount(i); n++)
      Log.Message(pickerview.wItem(n, i))
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("iPhone")
  # Obtain the PickerView object 
  p = Mobile.Device().Process("SampleApp")
  pickerview = p.Window(3).PickerView()
  
  for i in range (0, pickerview.wWheelCount):
    for n in range (0, pickerview.wItemCount[i]):
        Log.Message(pickerview.wItem[n, i])

VBScript

Sub Test()
  Dim p, pickerview
  ' Select the mobile device
  Mobile.SetCurrent("iPhone")
  ' Obtain the PickerView object
  Set p = Mobile.Device.Process("SampleApp")
  Set pickerview = p.Window(3).PickerView
  
  For i = 0 To pickerview.wWheelCount-1
    For n = 0 To pickerview.wItemCount
      Log.Message(pickerview.wItem(n, i))
    Next
  Next
End Sub

DelphiScript

procedure Test();
var
  p, pickerview, i, n;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the PickerView object
  p := Mobile.Device.Process('SampleApp');
  pickerview := p.Window(3).PickerView;
  
  for i := 0 to pickerview.wWheelCount-1 do
    for n := 0 to pickerview.wItemCount(i)-1 do
      Log.Message(pickerview.wItem(n, i))
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("iPhone");
  // Obtain the PickerView object
  var p = Mobile["Device"].Process("SampleApp");
  var pickerview = p["Window"](3)["PickerView"]();
  
  for (var i=0; i<pickerview["wWheelCount"]; i++)
    for (var n=0; n<pickerview["wItemCount"](i); n++)
      Log["Message"](pickerview["wItem"](n, i))
}

See Also

Testing iOS Applications
Working With iOS Picker View Controls - Basic Concepts
wItem Property (iOS Picker View Controls)

Highlight search results