title: Rselenium - Popup
body: <p>I want to download a file from a website using RSelenium, with Firefox browser.
  I do everything correctly (navigate, select the correct element and write what I want);
  now I click the "download" button, then a firefox popup opens and ask me if I want to download the file or "open with..." something else.</p>
  
  <p>Unfortunately I cannot write an example due to privacy constraints.</p>
  
  <p>My question is: how can I switch to the popup window / alert and click "OK" when needed?</p>
  
  <p>I tried the following methods with no success:</p>
  
  <pre><code>remDrv$acceptAlert()     -&gt; tells me: NoAlertOpenError  
  remDrv$executeScript("driver.switchTo().alert().accept()")
  </code></pre>
  
  <p>I also tried the method     </p>
  
  <pre><code>remDrv$getWindowHandles()
  </code></pre>
  
  <p>but even if the popup is open, the command return me one window only (the beginning one, not the popup), therefore I'm not able to use the:</p>
  
  <pre><code>remDrv$switchToWindow()
  </code></pre>
  
  <p>to switch to the popup window.</p>
  
  <p>Any ideas?
  Thanks</p>