wItemCount Property (Specific to iOS Picker View Controls)

Applies to TestComplete 15.64, last modified on May 16, 2024
This property is available in legacy mobile tests that work with devices connected to the local computer. To learn how to simulate user actions in newer cloud-compatible mobile tests, see the Simulating user actions in tests section.


Use the wItemCount property to get the total number of items in the specified control.



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
Wheel [in]    Optional    Integer Default value: 0   

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.


The property has the following parameter:


Specifies the index (from 0) of the wheel to work with. If it is not specified, the first wheel is used.

Property Value

The total number of items in the control (including separators).


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


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

JavaScript, JScript

function Test()
  // Select the mobile device
  // 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))


def Test():
  # Select the mobile device
  # 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])


Sub Test()
  Dim p, pickerview
  ' Select the mobile device
  ' 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))
End Sub


procedure Test();
  p, pickerview, i, n;
  // Select the mobile device
  // 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))

C++Script, C#Script

function Test()
  // Select the mobile device
  // 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

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

Highlight search results