SelectItem Action (Android Controls)

Applies to TestComplete 15.63, last modified on April 10, 2024
This method 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 SelectItem action to select the specified item in the control.


TestObj.SelectItem(Items, SelOption)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Items [in]    Required    Variant    
SelOption [in]    Optional    Boolean Default value: True   
Result None

Applies To

The method is applied to the following object:

View Mode

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


The method has the following parameters:


Specifies the caption or zero-based index of the desired item. The caption could contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk corresponds to a string of any length, the question mark corresponds to any single character. To specify more complicated parts of a caption, use regular expressions.

The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting.

If you enter -1, all items will be selected or deselected.


Specifies whether the item will be selected or deselected.

Value Description
True, or 1 The Item will be selected.
False, or 0 The Item will be deselected.

Result Value



If Item is -1, all the items will be selected or unselected. But if the control does not support multiselection, SelectItem will fail and post an error message to the test log.

If the specified item was not found, an error message is posted to the test log.


To view an example that demonstrates how to use the SelectItem action, see Selecting List View Items in Desktop Windows Applications.

See Also

Testing Android Applications (Legacy)
Selecting List View Items
MultiSelect Action (Android Controls)
CheckItem Action (Android Controls)
Touch Action (Mobile Objects)
TouchItem Method (Mobile Controls)

Highlight search results