title: Coded UI testing in multiple IE browser windows
body: <p>I am testing a chat client at a web service. I thought the best way to do this was to open the website in one internet explorer window, log in, open the chat. Then open a new IE window(in private mode so that the log in details will be forgotten) go the the page and then log in with another user and open the chat, and then start chatting with the other user in the other browser window. </p>
  
  <p>The problem is when I have done everything in the first window and I open a new window, all actions are triggered in the first window even though the second window is selected. Is there any way to select which browser window to use? Or are there better ways to test this functionality without opening two internet explorer windows?</p>
  
  <p><strong>Solved</strong>: I solved this by opening a new window in private mode. When I wanted to do actions in that window I defined the browser window as:</p>
  
  <pre><code>        BrowserWindow privateWindow = new BrowserWindow();
          privateWindow.SearchProperties.Contains("[InPrivate]");  
  </code></pre>