wSelectedItem 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.


The wSelectedItem property specifies which item of the wheel is selected.



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

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.


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

An integer value that indicates the index of the selected item.


If the specified item is not found, the property returns a null value (Nothing in VBScript, nil in DelphiScript, None in Python, null in JavaScript, JScript, C++Script and C#Script) and posts an error message to the test log.

If the specified item is not checkable, the wSelectedItem property returns False.


The following example iterates through picker view wheels and posts the index of the selected 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++)


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):


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
End Sub


procedure Test();
  p, pickerview, i;
  // 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

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++)

See Also

About Testing Android Applications (Legacy)
iOS PickerView Support
Getting the Selected Picker View Item

Highlight search results