title: Coded UI Test Dynamic Controls
body: <p>I have recorded a couple of coded ui tests to step through various data collection steps in our asp.net web application. However, we have custom code that renders html on the fly as a user steps through the "wizard" (just using wizard as generalized term). So from a browser perspective, the user will always be on the same page, for example, Wizard.aspx, but when the page is posted back, different html is rendered, with different controls</p>
  
  <p>As a result, when the coded test is running, it sometimes fails because after the post back, the html that is to be rendered hasn't been rendered quickly enough and the search cannot find the control, this happens on clicks as well, i.e the playback is trying to click a control, i.e. a button which may not have rendered yet, I've corrected this via manually adding ThinkTime between steps, but it feels like a hack. As a coded ui test is procceeding, is there a way to tell Playback to wait until the controls are rendered, I have seen the <a href="http://msdn.microsoft.com/en-us/library/ee823173.aspx" rel="nofollow">WaitForControlExist</a> method, but I can't quite figure out where to use it.</p>