Here the snapshot the ie download explorer
I have tried using robot but not working.
try
{
Robot robot = new Robot();
robot.setAutoDelay(250);
robot.keyPress(KeyEvent.VK_ALT);
Thread.sleep(1000);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_F4);
}
catch (AWTException e)
{
e.printStackTrace();
}
I have tried using System.out.println to check if the code navigates to the robot function. But the screen seems to be stuck after the line that prompting that download.
Is the current window not active ? Because if i try to click any element without saving the file it is not able to click.
Code to download is an icon
driver.findElement(By.xpath("//input[@name='ctl00$TrackerPlaceHolder$btnexcel']")).click();