This blog post has been updated to reflect changes in VS 2010 RC or later build. If you are on VS 2010 Beta 2, please upgrade before trying this post.
One question that keeps coming up is “How to configure search properties used by the recorder\code generation for identifying the control?”. For example, inform recorder that the Name of the certain control is dynamic and not to use it to identify the control.
Well, this feature per say is missing in VS 2010 release of Coded UI Test. However, there is a fairly simple workaround to this issue using the extensibility support of Coded UI Test. The configuring search properties may mean add or remove or change of search properties. Using the extensibility support, remove and change of search properties is possible but not add (unless you know the property value too).
The extensibility sample for this is attached to this post as RemoveUnwantedProperties.zip.
Before starting with this sample, ensure you have read at least the first two post on Coded UI Test Extensibility series.
Explaining the Sample -
Please note that since the sample is removing a search property, it might make the search criteria weak and result in playback failure. This is the reason for “claiming” this only a “workaround”.