Bringing you news, technical articles, and other useful content about Visual Studio ALM and Team Foundation Server
More videos »
This blog assumes that you have a prior understanding of Coded UI Test Search properties. If not, a good starting point would be here. This blog explains the new “configurable properties" feature of the Coded UI test that we added in VS Update 1.
Prior to VS Update 1, Coded UI Test records the controls with search properties and filter properties without any options of customization. For example, Recording a Mouse click on a button always generates the button with the same property list. Coded UI Test uses the search and filter properties to search for the control to complete the action during playback. However, Users might sometimes feel the need to customize the property list that Coded UI Test records because they have more knowledge of the controls than the Coded UI Test. For example, if we have a button whose text always changes, then there is no point in recording the “DisplayText” property and using it to search the button when it is unreliable.
With this update, Users will be able to customize the property list that gets recorded based on control type. You can configure the property list for each control type mentioned in the configuration. If we change the property configuration of a Button, then all the subsequent recordings on any button control will record the properties as per the new configuration.
With this update, you can configure search and filter properties of HTML controls while recording on Internet Explorer.
Supported Versions:
a. VS Ultimate b. VS Premium c. VS TestProfessional d. VSTF TestAgent e. VSTF TestController
Installation & Usage Experience:
<ControlType Name="Button"> <SearchProperties> <Property Name="Id"/> <Property Name="Name"/> <Property Name="DisplayText"/> <Property Name="Type"/> </SearchProperties> <FilterProperties> <Property Name="Src"/> <Property Name="Title"/> <Property Name="Class"/> <Property Name="ControlDefinition"/> <Property Name="TagInstance"/> </FilterProperties></ControlType>
Usage Examples:
Once you change the configuration file, there is no need to rebuild or restart Visual Studio. You only need to restart your Coded UI Test Recorder/Builder to get the desired changes. Let’s take an InputButton for example and see how Coded UI test records differently with different configurations:
<ControlType Name="InputButton"> <SearchProperties> <Property Name="Id"/> <Property Name="Name"/> <!-- <Property Name="DisplayText"/> --> <Property Name="Type"/> </SearchProperties> <FilterProperties> <Property Name="Src"/> <Property Name="Title"/> <Property Name="Class"/> <!-- <Property Name="ControlDefinition"/> --> <Property Name="TagInstance"/> </FilterProperties> </ControlType>
<ControlType Name="InputButton"> <SearchProperties> <Property Name="Id"/> <Property Name="Name"/> <Property Name="Title"/> <Property Name="Type"/> </SearchProperties> <FilterProperties> <Property Name="Src"/> <Property Name="DisplayText"/> <Property Name="Class"/> <Property Name="ControlDefinition"/> <Property Name="TagInstance"/> </FilterProperties> </ControlType>
Behaviour and Restrictions/Limitations:
ApplySmartConfiguration Attribute Usage and Behaviour:
Auto-Property Interchange:
Conditional Property Additions (based on ApplySmartConfiguration flag):