public static FirefoxProfile FirefoxDriverProfile() throws Exception
{
ProfilesIni allProfiles = new ProfilesIni();
//FirefoxProfile myProfile = allProfiles.getProfile("default");
FirefoxProfile profile = allProfiles.getProfile("default"); //new FirefoxProfile();
profile.setPreference("browser.download.folderList", 2);
profile.setPreference("browser.download.manager.showWhenStarting", false);
profile.setPreference("browser.download.dir", "\\INAIRDT541539\\downloads"/*getPath(Constants.DOWNLOADPATH)*/);
profile.setPreference("browser.helperApps.neverAsk.openFile", "text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml");
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml");
profile.setPreference("browser.helperApps.alwaysAsk.force", false);
profile.setPreference("browser.download.manager.alertOnEXEOpen", false);
profile.setPreference("browser.download.manager.focusWhenStarting", false);
profile.setPreference("browser.download.manager.useWindow", false);
profile.setPreference("browser.download.manager.showAlertOnComplete", false);
profile.setPreference("browser.download.manager.closeWhenDone", false);
profile.setPreference("webdriver.log.file", "c:\\temp\\firefox.log");
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);
return profile;
}
caps = DesiredCapabilities.firefox();
caps.setBrowserName("firefox");
caps.setPlatform(Platform.WINDOWS);
caps.setCapability(FirefoxDriver.PROFILE, FirefoxDriverProfile());
driver = new RemoteWebDriver(new URL("http://<IP Address>:5566/wd/hub"), caps.firefox(), caps);