title: How would you check if a popup window exists using selenium webdriver?
body: <p>I am running link tests on an application and one of the links brings up a login popup window. Is there a way to check for that? I tried treating it like an alert but it didn't work.</p>
  
  <pre><code>try
     {
       WebDriverWait wait = new WebDriverWait(driver, 2);
       wait.until(ExpectedConditions.alertIsPresent());
       Alert alert = driver.switchTo().alert();
       alert.accept();
       reportAlertPresent = true;
      }
  </code></pre>