I want to download a file from a website using RSelenium with a Firefox browser. I am doing everything right (moving around, choosing the right element and writing down what I want); now I click on the “download” button, then a firefox popup window opens and asks if I want to download the file or “open with ...” something else.
Unfortunately, I cannot write an example due to privacy restrictions.
My question is: how can I switch to a popup / warning and click “OK” when necessary?
I tried the following methods without success:
remDrv$acceptAlert() -> tells me: NoAlertOpenError
remDrv$executeScript("driver.switchTo().alert().accept()")
I also tried the method
remDrv$getWindowHandles()
but even if the popup is open, the command returns me only one window (the initial one, not the popup), so I cannot use:
remDrv$switchToWindow()
to go to the popup.
Any ideas? Thanks