Please suggest an idea with following points implementations
1.how to handle the Download popup in IE with Selenium Webdriver with JAVA?
2.how to store that xml file in different location by using JAVA?
Note: we will pass 'n' number of Inputs and each input have an xml file , required all the xml file download and save in different location
I would recommend you NOT to automate file download using selenium. It's a trap you don't want to fall for. File download works differently in different browsers. People will recommend using AutoIT, but it only works for windows, so cross platform testing is not possible. Since you use Java bindings, you could use the Robot class, to move your mouse pointer to a certain location on the window and send a native click. In my experience this solution is really flaky. You don't know the exact location where you must click and with Robot you are blindly clicking on things. To add to this, when you are running tests on remote machine using selenium grid, things get even more difficult.
So how do you download the file? Just get the underlying link to download the file available in your DOM and fire a GET request. Download the content if you want to validate the file. If you don't want to validate the content, just response code is fine. Here is a fantastic blog with Java examples on how to download files in the background using http requests and detailed explanation on why downloading files using selenium is a bad idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With