title: How to check if a popup window is open or not using Selenium WebDriver in Java
body: <p>I'm trying to check whether the popup window I want to open is opened or not.</p>
  <p>I have checked some question answers like</p>
  <blockquote>
  <p><a href="https://stackoverflow.com/questions/24911681/how-would-you-check-if-a-popup-window-exists-using-selenium-webdriver">How would you check if a popup window exists using selenium webdriver?</a></p>
  </blockquote>
  <p>But, nothings helped to solve the problem.</p>
  <p>Here, first I open the login window by clicking the login button.</p>
  <pre><code>driver.findElement(By.xpath(&quot;//a[@id='login_btn']&quot;)).click(); // Click Login Button
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Ufb44.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ufb44.jpg" alt="login" /></a></p>
  <p>I even tried <code>getPageSource()</code> but, it seems not working.</p>
  <p>Any kind of help would be appreciated.</p>
  <p>Thanks in advance. :)</p>