wText Property (Edit Controls)

Applies to TestComplete 14.71, 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

Use the wText property to get or set the text displayed in an edit control.

Declaration

TestObj.wText

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

A string holding the text displayed by the control.

Remarks

If an edit control works in password mode, that is, it masks its actual text with a pre-defined character, the wText property contains the actual text rather than the masked text displayed to the user.

After assigning a new value to the wText property, the insertion point is moved to the beginning of the text.

Note that to change text in an edit control, you can also use the SetText action. Unlike the wText property, SetText adds an entry to the test log about the performed operation.

If your tested application uses event handlers to detect and handle text changes or keyboard input in edit controls, keep in mind that the wText property raises only text change events and does not raise keypress events. If the expected events do not occur when you use the wText property to change a control’s text, use the Keys action instead.

Example

To view an example that demonstrates how to use the wText property, see Getting an Edit Control's Text.

See Also

SetText Action (Edit and Combo Box Controls)
Keys Action
wSelection Property (Edit Controls)
wSelectionStart Property (Edit Controls)
wSelectionStart Property (Specific to DevExpressMemoEdit, DevExpressTextEdit, JFXSwingTextField and SilverlightTextBox Controls)
wSelectionEnd Property (Edit Controls)
wSelectionEnd Property (Specific to DevExpressMemoEdit, DevExpressTextEditand SilverlightTextBox Controls)

Highlight search results