Information in this topic applies only to web tests that implement the default approach. This property is not supported in cross-platform web tests. |
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.
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:
Developer Express ButtonEdit, Developer Express HyperlinkEdit, Developer Express MemoEdit and 20 more objects, Developer Express PasswordBoxEdit, Developer Express TextEdit, Infragistics WebMaskEdit, Infragistics WebTextEdit, Java FX PasswordField, Java Swing Password Field, Java Swing TextArea, Java Swing TextField, MFC Edit Browse, Oracle Forms Text Field, Qt LineEdit, Qt Text Edit, Silverlight AutoCompleteBox, Silverlight RichTextBox, Silverlight TextBox, Telerik RadMaskedEditBox for WinForms, Telerik RadMaskedXXXInput for Silverlight, Telerik RadTextBox for WinForms, Win32 Edit, WPF TextBox « Collapse the list
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.
See Also
wSelectionStart Property (Edit Controls)
wSelectionEnd Property (Edit Controls)
wText Property (Edit Controls)