title: How to Handle Browser Popup (During the Download) using Java
body: <p>currently we scrap the data from Websites using Web driver (Selenium)with Java, during that Scrapping we need to do some download process (i.e XML file Download), let me know how will handle the Browser Popup (save As Dialog) using Java</p>
  
  <pre><code>&lt;a href="javascript:downloadXML()"&gt;
      &lt;img width="40" height="20" border="0" name="imag34" alt="Download" src="/pair/img/tabs/downloadxml.gif"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>We are using the following code to click the above image</p>
  
  <pre><code>driver.findElement(By.xpath("(//img[@alt='Download'])[3]")).click();
  </code></pre>
  
  <p>After clicking that image, it will open a "Save as.." popup. How do we go to that popup and do testing on that?</p>
  
  <p><img src="https://i.stack.imgur.com/TmHyT.png" alt="enter image description here"></p>