Monday, 10 November 2014

Search Configurations for the control in CodedUI


Apart from the control specific properties, some other properties may be required to identify the control, e.g., if the control is nameless or the parent has to be expended before looking for a control e.g, tree item. Following are some of those.

Search configuration of the control


We have some predefined search configuration which helps to narrow down the search space (search only in visible controls) or to do perform some prerequisite before actually starting the search (expand parent tree node before searching for the child node). Following are the different search configs:

SearchConfig ParameterDescription
AlwaysSearchUITest uses a cache while doing actions on an Application by adding Always Search in the search config user can force UITest to not to use the cached value for the control.
DisambiguateSearchIf the parent and the controls properties are same there are chances that UITest would start doing action on the parent itself. This config can be used to ask the playback to act on its child rather than the parent itself.
ExpandWhileSearchingExpand the control before looking for the other control inside it. E.g., TreeView
NextSiblingSearch in the siblings inside the container. Sometime if the control is nameless we may iterate from the named control inside the same container to reach the control.
VisibleOnlySearch only in the visible control. It helps to reduce the search space.