title: How to handle external popup using selenium
body: <p>In my project, there has one advertisement provider who shows us pop up advertisement but Problem is this pop-up will come it's not fixed.Sometimes add not show sometimes comes this pop up after 1 minute and interrupts my test case.</p>
  
  <p>I write a code for close this popup but it's not a perfect solution I think..If anyone can help?</p>
  
  <pre><code>boolean Imclose = wd.findElement(By.xpath(".//*[@class='IM_overlay_close_container IM_overlay_close_button']")).isDisplayed();
      if (Imclose == true) {
          wd.findElement(By.xpath(".//*[@class='IM_overlay_close_container IM_overlay_close_button']")).click();
      }
  </code></pre>