Monday, January 13, 2014

Downloading a file using selenium webdriver

Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
FirefoxProfile prof=new FirefoxProfile()
prof.setPreference("browser.downLoad.folderList", 2);
prof.setPreference("browser.helperApps.neverAsk.saveToDisk", "Applications/zip");

No comments:

Post a Comment