Version

xamEditors - Replay-Only Methods

Topic Overview

Purpose

This topic provides reference information about the replay-only user methods for testing the xamEditors that are common to all these editors. For information about the editor-specific recordable user methods for a particular editor, see its respective topic.

xamEditors Test Objects Replay-Only Methods

Supported editor controls

The methods covered in this topic apply to the following controls:

  • xamDateTimeEditor™

  • xamNumericEditor™

  • xamCurrencyEditor™

  • xamMaskedEditor™

  • xamComboEditor™

  • xamTextEditor™

  • xamCheckEditor™

Replay-only methods summary

The following table briefly explains the replay-only methods for testing the control. Detailed information about the methods is provided below the table.

Method Description

Sets the cursor position in the editor.

Selects all the text in the editor.

Selects a range in the text.

SetCaretPos

Description

This method replays the cursor positioning in the text editor.

Details

No additional details.

Parameters

The following table explains the method’s parameters along with some sample code.

Method Parameter Description

Caret position

( required )

The caret position specifies where to place the cursor in the xamEditors.

Example

Setting the cursor position after 3 letters in a xamTextEditor:

WpfWindow("MainWindow").XamTextEditor("xamTextEditor").Set "Text here …​"

WpfWindow("MainWindow").XamTextEditor("xamTextEditor").SetCaretPos 3

Default setting

This method takes the caret position as a parameter.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

The specified index is out of range.

The caret position cannot be set because it falls out of the valid range.

The method parameter value is not valid.

SelectAll

Description

This method replays the selection of the editor’s text.

Details

No additional details.

Parameters

No parameters are used with this method.

Example

Selecting all the text in a xamTextEditor:

WpfWindow("MainWindow").XamTextEditor("xamTextEditor").SelectAll

Default setting

No default setting.

Possible exceptions

No known exceptions.

SetSelection

Description

This method replays selecting a range in the content of the text editor.

Details

No additional details.

Parameters

The following table explains the method’s parameters along with some sample code.

Method Parameter Description
  • Starting position

  • Selection length

The starting position specifies the caret position in the text and the selection length specifies how many symbols will be selected.

Example

Selecting a new range of text after the 4 letter and 6 letters after it:

WpfWindow("MainWindow").XamTextEditor("xamTextEditor").Set "Text here …​"

WpfWindow("MainWindow").XamTextEditor("xamTextEditor").SetSelection 4, 6

Default setting

This method takes the start position and the selection length as parameters.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

The specified index is out of range.

The start caret position cannot be set because it falls out of the valid range.

The start position method parameter value is not valid.

Related Content

Topics

The following table lists other topics you may find useful.

Topic Purpose

This topic provides reference information about the replay-only user methods for testing the xamMonthCalendar™ control.

This topic provides information about the user actions of the xamEditors controls which you can test and the elements you can inspect.

This topic provides reference information about the recordable user methods for testing the xamEditors that are common to all these editors.

This topic provides reference information about the test object properties of the xamEditors that are common to all these editors.

This topic provides reference information about the proxy class that supports the testing of the xamEditors™ controls in Micro Focus Unified Functional Testing software.