I am using selenium web driver and downloading .pdf files from internet using firefox, but i could not able to save these files on local machine using relative path ( i am using windows 7 32 bit machine ). It is working fine if i am using absolute path. But i only want to use relative path as i also need to run it on server later. My Code:
public static void main(String args[]) throws ClassNotFoundException, IOException{
FirefoxProfile fprofile = new FirefoxProfile();
fprofile.setPreference("browser.download.useDownloadDir", true);
fprofile.setPreference("browser.download.dir", "./Folder");
fprofile.setPreference("browser.download.folderList", 2);
fprofile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf;");
fprofile.setPreference( "browser.download.manager.showWhenStarting", false );
fprofile.setPreference( "pdfjs.disabled", true );
fprofile.setPreference("plugin.scan.plid.all", false);
fprofile.setPreference("plugin.scan.Acrobat", "99.0");
WebDriver driver = new FirefoxDriver(fprofile);