CheckItem Action (Toolbar Controls)

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

The method moves the mouse pointer to a toolbar item and then changes the item’s state according to the Checked parameter value.

Declaration

TestObj.CheckItem(ItemChecked)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Item [in]    Required    Variant    
Checked [in]    Required    Variant    
Result None

Applies To

The method is applied to the following objects:

View Mode

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

Parameters

The method has the following parameters:

Item

Specifies the desired item. You can enter the item’s index (from 0) or its caption. The caption can contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk (*) corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). 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.

Checked

Specifies the item’s state:

Value Description
cbUnchecked, False or 0 The item is unchecked.
cbChecked, True or 1 The item is checked.
cbGrayed or 2 The item is grayed.

Result Value

None.

Remarks

If the specified item is not found, CheckItem fails and posts an error message to the test log.

The CheckItem method can be used to simulate user actions only over those toolbar items that are either the CheckBox or the ToggleButton control. If the specified toolbar item is neither the CheckBox, nor the ToggleButton control, the method will post an error message to the test log. To determine whether the specified item is the CheckBox or ToggleButton control, use the wIsCheckButton property.

To determine whether the specified item is already in the checked or unchecked state, use the wChecked property.

See Also

CheckItem Action (Specific to Mycrosoft, Infragistics, Syncfusion, and Telerik ToolBar Controls)
wIsCheckButton Property (ToolBar Controls)
wChecked Property (ToolBar Controls)

Highlight search results