title: How to limit a Coded UI Test control search
body: <p>Using MS Coded UI, is there a way to specify that a search for a control must begin at a specific parent?</p>
  
  <p>I'm performing a search for a control, and I want to perform different actions based on the success or failure of that search.  Unfortunately, the search is always successful (regardless of the existence of the control at question) because of another control (with an entirely different parent) that has an identical automation id (the application is quite large, and consequently this happens frequently).</p>
  
  <p>I'm guessing that the search starts at the specified parent and looks for the desired control.  When it is not found, I believe the search starts again from the root, and this time the identically named control is found (though it is not the one I'm interested in and it is part of a different subtree).</p>
  
  <p>My question is whether or not you can limit the search for a control to a particular subtree.  For example, consider the case where the primary view, Main, has two subviews View1 and View2.  Each  subview contains a control with an auto ID of "coolControl."</p>
  
  <p>Is there a way to limit the UI search so that a search will only be successful if it is found under a particular parent (say View1)? Upon failure, can I prevent the search from restarting at the root?</p>