wState Property (CheckBox and ToggleButton Controls)

Applies to TestComplete 14.60, last modified on April 22, 2021
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.
Note: The following controls do not support this value:
  • Bootstrap Checkbox
  • Bootstrap Toogle Button
  • Ext JS Toggle Button
  • Ext JS Checkbox Field
  • Java Swing CheckBox
  • JavaFX ToggleButton
  • jQuery Mobile Checkbox
  • jQuery Mobile FlipSwitch
  • Oracle Forms Checkbox
  • Telerik RadCheckBox for WinForms
  • Telerik RadToggleButton for WinForms
  • YUI 2 Checkbox Button

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.

See Also

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

Highlight search results