wState Property (CheckBox and ToggleButton Controls)

Applies to TestComplete 15.45, last modified on December 01, 2022
This property is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This property can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

A check box control can be in the checked, unchecked or grayed state. Use the wState property to specify the current state of a check box control.

Declaration

TestObj.wState

Read-Write 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 objects:

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 wState property can have one of the following values:

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

The following controls do not support this value:

Remarks

Microsoft CheckBox: A check box control can be in the grayed state only if the check box allows three states (the check box’s “native” ThreeState property is True). If ThreeState is False, the check box can only be checked or unchecked.

Silverlight CheckBox, WPF CheckBox: A check box control can be in the grayed state only if the check box allows three states (the check box’s “native” IsThreeState property is True). If IsThreeState is False, the check box can only be checked or unchecked.

JavaFX CheckBox: A check box control can be in the grayed state only if the check box allows three states (based on the value of the check box’s native allowIndeterminate field). If allowIndeterminate is Null Object, the check box can only be checked or unchecked.

Example

To view an example that demonstrates how to use the wState property, see Determining a Check Box's State in Desktop Windows Applications.

See Also

Determining a Check Box's State in Desktop Windows Applications
Selecting and Clearing Check Boxes in Desktop Windows Applications
ClickButton Action (CheckBox and ToggleButton Controls)

Highlight search results