title: Coded UI Test for a website having lots of ajax calls
body: <p>I tried to create a Coded UI Test for performance load test of websites that has lots of ajax calls -- the service server is ASP.NET. Once the page is loaded, automatically ajax requests are invoked.</p>
  
  <p>BrowserWindow instance is used to open the website, and its WaitForControlReady method is used to see if the page is loaded or not. However, WaitForControlReady method does not check ajax calls, so the test finishes before the response arrives. My code is like below:</p>
  
  <pre class="lang-cs prettyprint-override"><code>BrowserWindow bw = BrowserWindow.Launch();
  foreach(string url in URLList.urls)
  {
      DateTime startTime = DateTime.Now;
      bw.NavigateToUrl(new System.Uri(url));
      bw.WaitForControlReady();
      DateTime stopTime = DateTime.Now;
      TimeSpan duration = stopTime - startTime;
      TestContext.WriteLine(duration.ToString() + " - " + url);
  }
  </code></pre>
  
  <p>Is there any way to track ajax calls so that I can check the accurate loading time?</p>