We can automate this using Java Robort frame work, Please find the code as follows,
public void enterFilePathInBrowseWindow(String filePath)
{
Robot copyRobot, submitRobot ;
Clipboard clipboard ;
StringSelection stringSelection ;
try {
copyRobot = new Robot();
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
stringSelection = new StringSelection( filePath );
clipboard.setContents(stringSelection, null);
copyRobot.delay(1000);
copyRobot.waitForIdle();
copyRobot.keyPress(KeyEvent.VK_CONTROL);
copyRobot.keyPress(KeyEvent.VK_V);
copyRobot.keyRelease(KeyEvent.VK_V);
copyRobot.keyRelease(KeyEvent.VK_CONTROL);
submitRobot = new Robot();
submitRobot.keyPress(KeyEvent.VK_ENTER);
submitRobot.keyPress(KeyEvent.VK_ENTER);
submitRobot.keyRelease(KeyEvent.VK_ENTER);
copyRobot.delay(500);
}
catch (AWTException ex)
{
ex.getMessage();
}
}
Try this by passing upload location.
Venkat.