wSelection Property (Edit Controls)

Applies to TestComplete 15.47, last modified on January 20, 2023
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

Use the wSelection property to obtain the text, which is currently selected in the edit control. To get the starting and ending character positions of the selected text, use the wSelectionStart and wSelectionEnd properties, respectively.

To obtain the entire text displayed in the edit control, use the wText property.

To select text in the edit control, use the Keys action to simulate the appropriate text selection shortcuts. For more information, see Selecting Text Within an Edit Control in Desktop Windows Applications.

Declaration

TestObj.wSelection

Read-Only Property String
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 text selected in the edit control. If no text is selected, the property returns an empty string.

Remarks

Note concerning Telerik RadControls for WinForms 2011.1: Due to incorrect functioning of the Telerik MaskedEditBox control, the wSelection property of the TelerikMaskedEditBox object may return an incorrect value.

Example

To view an example that demonstrates how to use the wSelection property, see Getting the Selected Text in an Edit Control in Desktop Windows Applications.

See Also

wSelectionStart Property (Edit Controls)
wSelectionEnd Property (Edit Controls)
wText Property (Edit Controls)

Highlight search results