Sample Excel Extension: ActionFilter Class


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Sample Excel Extension: ActionFilter Class.

This internal class extends the UITestActionFilter class and represents a filter for test actions on a Microsoft Excel element.

These read-only properties enable the developer to specify how this test action filter is to be executed by the coded UI testing framework. For example, the Name property provides the name of the action filter. Other properties get the Category of the action filter, the FilterType, the Group name for the test actions that are filtered by this test action filter. Others indicate whether to ApplyTimeout and also whether the test action is Enabled.

This method is called by the coded UI testing framework, and executes the filter against the provided IUITestActionStack. This particular override removes a mouse choose action on a cell when the next action in the stack sends keystrokes to the cell. It then returns false.

The IsLeftClick method determines whether the provided action represents a left-click of the mouse. The AreActionsOnSameExcelCell method determines whether two provided actions are executed on the same cell in Excel.

Extending Coded UI Tests and Action Recordings to Support Microsoft Excel