Handle download file dialogue in ie | Selenium Forum
M
Posted on 21/06/2016
Sir,
i navigate to a url in ie
FileDownload dialogue pops up in ie
I need to handle this & go click "Save" button

Have used following script :IE_OPEN2.exe

WinWait("Windows Internet Explorer")
WinActive("Windows Internet Explorer")
Sleep(500)
ControlClick("Windows Internet Explorer","","Button2")
Sleep(300)
--------------------------------------------------------
calling via Runtime.getRuntime().exec("C:\\Users\\sonso\\Documents\\IE_OPEN2.exe");


[b:2jpd7tdo]Never seems to work...Am badly struck[/b:2jpd7tdo]
[b:2jpd7tdo]Query:Sir,could you give your inputs pls[/b:2jpd7tdo]

M
Replied on 21/06/2016

Sir,

i tried this too:

public static void clickAndSaveFileIE() throws InterruptedException{
try{
Robot robot = new Robot();
//element.sendKeys("");
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER); //wait for the modal dialog to open
Thread.sleep(2000); //press s key to save
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_S);
Thread.sleep(2000); //press enter to save the file with default name and in default location
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
} catch (AWTException e) {
e.printStackTrace();
}

}

[b:16i0q1am][b]i called this function.......
Query:Still does not work[/b:16i0q1am]
Request for your inputs.[/b]


M
Replied on 22/06/2016

you can use robot, Autoit or sikuli.

i'll recommend Robot.


M
Replied on 27/06/2016

Tried Robot class sir ....Dint work..

Retried AUTOIT...worked after a lot of trial & errors ...Thankz alot for your inputs Responsive image