Sample Excel Extension: PropertyProvider Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

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

This internal class extends the UITestPropertyProvider class and provides property services for Microsoft Excel elements to record and play back user interface (UI) tests.

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.

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

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

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.

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

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

Show: