I am trying to download a file using selenium webdriver but the test stops as soon as it encounters the IE10 download dialog box. How do I click save on this dialog box? Will Robot API help?
Asked
Active
Viewed 2,599 times
1 Answers
1
The short answer: This has been asked many times, please search.
The long and more correct answer: As of now (2013/10), it can't be done via WebDriver. It's one of the most requested features for the Selenium project.
You can try one of these things:
- Make a request for the specified link using HttpURLConnection or Apache HttpComponents. You can even download the file this way, although the usual practice is just to assert a 200 OK response to make sure that the file can be downloaded (since you usually don't really need the file when you're testing your application).
- Snatch the file using any Java approach. Or this tool made by someone to be used with Selenium.
- Use the Robot class to simply press Down arrow and Enter or something. But beware, this will only work for your particular browser and OS. It will most likely break on any other configuration.

Community
- 1
- 1

Petr Janeček
- 37,768
- 12
- 121
- 145