Version

Navigating and Selecting

Topic Overview

Purpose

This topic provides reference information about the recordable user methods for testing the navigation and selection actions in xamDataPresenter™ controls.

Recordable Methods

Recordable methods summary chart

The following table briefly explains the recordable methods for testing the control. Detailed information about the methods is provided in the text blocks following the table.

Method Description

ActivateCell

Activates the specified cell.

ActivateRecord

Activates the specified record.

ExpandRecord

Expands the specified record.

CollapseRecord

Collapses the specified record.

Select

Selects one or more items of a particular type.

SelectionAdded

Adds one or more items of a particular type to the existing selection.

SelectionRemoved

Removes one or more items of a particular type from the existing selection.

SelectionChanged

Adds and removes one or more items of a particular type from the existing selection.

ActivateCell

Description

The ActivateCell method is used for recording and replaying the cell activation action performed by the user.

Details

When replaying, this method performs some validations first and then activates a cell:

  1. Validating the specified cell path,

  2. Activating the cell

The method accepts as a parameter the cell path in the active field layout.

The path is formed by concatenating the record path and the field name or field index (the parenthesis and the brackets are part of the syntax):

{record path}[field name or field index]

For example, the cross-section of the first record and the field name is denoted as {0 }[ name], the cross-section of the first child record of the first record and the field name is denoted as {0}{0}[name] .

Parameters

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

Method parameter Description

Cell path

Using the cell path as a parameter.

Example

Activating the cell in the “Title” field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").ActivateCell "{1}{2}[Title]"

Default setting

No default setting.

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 following cell was not found.

The cell cannot be located when replaying the method.

The cell doesn’t exist.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

ActivateRecord

Description

The ActivateRecord method is used for recording and replaying the record activation action performed by the user.

Details

When replaying, this method performs some validations first and then activates the specified record:

  1. Validating the specified record path,

  2. Activating the record

The method accepts as a parameter the number of the record in the active field layout. The numbering starts from 0.

The record path is formed in the following way:

  • root record number

  • {root record number}{parent record number}

  • {root record number}{parent record number}{child record number}

Parameters

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

Method parameter Description

Record path

Using the record path as a parameter.

Example

Activating the third child record of the first root record:

WpfWindow("MainWindow").XamDataGrid("dataGrid").ActivateRecord "{0}{2}"

Default setting

No default setting.

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 following record was not found.

The record cannot be located when replaying the method.

The record doesn’t exist or is hidden.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

ExpandRecord

Description

The ExpandRecord method is used for recording and replaying the record expanding action performed by the user.

Details

When replaying, this method performs some validations first and then expands the record:

  1. Validating the specified record path,

  2. Expanding the record

The method accepts as a parameter the record path in the active field layout.

The record path is formed in the following way:

  • root record number

  • {root record number}{parent record number}

  • {root record number}{parent record number}{child record number}

Parameters

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

Method parameter Description

Record path

Using the record path as a parameter.

Example

Expanding the first root record:

WpfWindow("MainWindow").XamDataGrid("dataGrid").ExpandRecord 0

Default setting

No default settings.

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 following record was not found.

The record cannot be located when replaying the method.

The record doesn’t exist or is hidden.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

CollapseRecord

Description

The CollapseRecord method is used for recording and replaying the record collapsing action performed by the user.

Details

When replaying, this method performs some validations first and then collapses the record:

  1. Validating the specified record path

  2. Collapsing the record

The method accepts as a parameter the record path in the active field layout.

The record path is formed in the following way:

  • root record number

  • {root record number}{parent record number}

  • {root record number}{parent record number}{child record number}

Parameters

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

Method parameter Description

Record path

Using the record path as a parameter.

Example

Collapsing the first root record:

WpfWindow("MainWindow").XamDataGrid("dataGrid").CollapseRecord 0

Default setting

No default settings.

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 following record was not found.

The record cannot be located when replaying the method.

The record doesn’t exist or is hidden.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

MoveField

Description

The MoveField method is used for recording and replaying the moving of a particular field from the initial location to a new location performed by the user.

Details

The method accepts as a parameter the name of the field to be moved and the customization information saved during the recording while the field moving is performed by the user.

Parameters

The following table explains the method’s parameters.

Method parameter Description

sFieldName

The name of the field to be moved.

sCustomizations

The customizations XML which is saved during the recording of the field moving performed by the user.

Default setting

No default settings.

Possible exceptions

No known exception.

Select

Description

The Select method is used for recording and replaying the item selection action performed by the user.

Details

The method takes the selectable item type and an item as parameters.

The selectable item types are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

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

Method parameter Description
  • Selectable item type

  • Selected item(s)

Example 1

When selecting a field, you can use either the field name or index:

Selecting the Author field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").Select gridField, "[Author]"

Selecting the second field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").Select gridField, 1

Example*2

Selecting the first record:

WpfWindow("MainWindow").XamDataGrid("dataGrid").Select gridRecord, 0

Example*3

Selecting a cell in the Author field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").Select gridCell, "{0}{0}[Author]"

Default setting

No default setting.

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 following items have not been found.

The specified item cannot be located when replaying the method.

The selected item path is not correct.

SelectionAdded

Description

The SelectionAdded method is used for recording and replaying the muliple selection action performed by the user.

Details

The method accepts the selectable item type and item to be added in existing selection as parameters.

The selectable item types are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

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

Method parameter Description
  • Selectable item type

  • New item to be added

Using the selectable item type and item to be added as parameters.

Example

Adding three cells to the selection:

WpfWindow("MainWindow").XamDataGrid("dataGrid").Select gridCell, "{1}{1}[Isbn]"

WpfWindow("MainWindow").XamDataGrid("dataGrid").SelectionAdded gridCell, "{1}{1}[Title]"

WpfWindow("MainWindow").XamDataGrid("dataGrid").SelectionAdded gridCell, "{1}{1}[Author]"

Default setting

No default setting.

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 following items have not been found.

The item that has to be added to the selection can’t be located when replaying.

The selected item path is not correct.

SelectionRemoved

Description

The SelectionRemoved method is used for recording and replaying the removal of an item from existing selection.

Details

The method takes the selectable item type and item to be removed from existing selection as parameters.

The selectable item types are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

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

Method parameter Description
  • Selectable item type

  • Item to be removed

Using a selectable item type and an item to be removed as parameters.

Example

Removing a cell from a selection:

WpfWindow("MainWindow").XamDataGrid("dataGrid").SelectionRemoved gridCell,"{1}{1}[Title]"

Default setting

No default settings.

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 following items have not been found.

The item that has to be removed from the selection can’t be located when replaying.

The selected item path is not correct.

SelectionChanged

Description

The SelectionChanged method is used for recording and replaying the changes (adding and removing of items) in existing selection.

Details

The method takes a selectable item type and items to be added and removed from existing selection as parameters.

The selectable item types are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

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

Method parameter Description
  • Selectable item type

  • Array of items to be added

  • Selectable item type

  • Array of items to be removed

The method takes two arrays of items to be added and to be removed.

Example

Changing the cell selection – adding and removing items of type gridCell :

WpfWindow("MainWindow").XamDataGrid("dataGrid").SelectionChanged gridCell, ARRAY("{1}{4}[Title]", "{1}{5}[Title]", "{1}{6}[Title]"),gridCell, Array("{1}{5}[Title]")

Default setting

No default setting.

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 following items have not been found.

The item that has to be removed from the selection can’t be located when replaying.

The selected item path is not correct.

Related Content

Topics

The table below lists other topics you may find useful.

Topic Purpose

This topic provides reference information about the recordable user methods for testing the editing in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the filtering in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the sorting and grouping user actions in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the summary feature in xamDataPresenter™ controls.