5. Property Provider of Sample Excel Extension
This is the fifth post in this series on the extensibility of Coded UI Test. Before reading this, you should read the previous posts of this series to better understand this post.
The ExcelPropertyProvider class extends from UITestPropertyProvider. It provides information about the properties that the corresponding UI element (in this case ExcelCellElement) can have and gives a way to get\set those properties. Let me explain the important methods here –
|
This method is similar to the UITechnologyManager.GetControlSupportLevel() method explained in previous post. This lets engine find out the most suitable property provider for a control dynamically.
|
This gets the names of all the properties supported by this control.
|
This gets the property descriptor for a given property. The descriptor gives information on what is the data type of the property, which category it belongs to (which is used in Spy control to group the properties) and the attributes of the property (like readable, writeable searchable).
|
This is the actual get\set method which is called by the engine to allow user to get\set on the properties. No check is done by the engine on either the name of the property or the possible type\allowed value of the property value.
Apart from the above, the property provider also contains bunch of methods that allow customization of code generated by the tool. I will cover this in some future post.
The last post is the one explaining the action filter in the Excel Extension sample.