title: WatiN testing of a popup
body: <p>I have an application that brings up a popup window when you click a link. I have a watin test that naviates to the page and clicks a link to open the popup. This is my current code:</p>
  
  <pre><code> [Test]
   public void TestCommentBoxInput()
          {
  
                  window.GoTo("mylocalurl");
                  window.Link(Find.ById("popuplink.aspx")).Click();
                  IE iepopup_1 = IE.AttachTo&lt;IE&gt;(Find.ByUrl("popuplinkurl.aspx"));
                  iepopup_1.TextField(Find.ById("txtComments")).TypeText("Commenttest");
           }
  </code></pre>
  
  <p>As you can see I tried attatching the popup window to the created browser called window. When I run my test it just stops at the popup window and never enters text in the box. How do I go about making my program regonize that it is now to be operating on the popup and not the original window?</p>
  
  <p>EDIT: I am dealing with a Modal Dialog.</p>