Sample Excel Extension: ActionFilter Class
Note
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
This internal class extends the UITestActionFilter class and represents a filter for test actions on a Microsoft Excel element.
Simple Properties
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 UITestActionFilter.Name
property provides the name of the action filter. Other properties get the UITestActionFilter.Category
of the action filter, the UITestActionFilter.FilterType
, the UITestActionFilter.Group
name for the test actions that are filtered by this test action filter. Others indicate whether to UITestActionFilter.ApplyTimeout
and also whether the test action is UITestActionFilter.Enabled
.
ProcessRule Method
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
.
Private Methods
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.