Share via


Sample Excel Extension: PropertyProvider 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 UITestPropertyProvider class and provides property services for Microsoft Excel elements to record and play back user interface (UI) tests.

GetControlSupportLevel Method

The GetControlSupportLevel method returns a number that indicates the level of support that the property provider can offer for the provided control. The higher the returned value, the more the property provider can support the control. In this case, the method checks the value of the TechnologyName property of the provided control. If the value is "Excel" and if the ControlTypeName indicates it is a CellElement, the method returns the highest value; otherwise, it returns zero, which indicates that no support is provided.

GetPropertyNames Method

Returns a dictionary of property names and property descriptors for the supported properties of an Excel Cell control.

GetPropertyDescriptor Method

This method is called by the testing framework to get the predefined property descriptor for the provided property name.

GetPropertyValue and SetPropertyValue Methods

The GetPropertyValue method uses the Communicator class of this extension to return the property value from Excel. The SetPropertyValue method uses the Keyboard class and the Communicator component to set the property value. These methods are called by the testing framework.

Code Generation Customization Methods

These methods are not implemented for this extension. Therefore, they either return null or throw the NotImplementedException.

See Also

UITestPropertyProvider Keyboard Extending Coded UI Tests and Action Recordings to Support Microsoft Excel