package FileDownloads;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class FileDownload {
public static void main(String[] args) throws InterruptedException {
FirefoxProfile Prof = new FirefoxProfile();
Thread.sleep(3000);
Prof.setPreference("browser.download.dir", "D:\\java prj");
Prof.setPreference("browser.download.folderList", 2);
Prof.setPreference("browser.helperApps.neverAsk.saveToDisk","application/zip");
WebDriver driver = new FirefoxDriver(Prof);
driver.get("http://www.bcfi.be/download/");
driver.manage().timeouts().implicitlyWait(3,TimeUnit.MINUTES);
driver.findElement(By.xpath("//*[@id='datatable']/tbody/tr[3]/td[3]/form/input")).click();
}
}
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class FileDownload {
public static void main(String[] args) throws InterruptedException {
FirefoxProfile Prof = new FirefoxProfile();
Thread.sleep(3000);
Prof.setPreference("browser.download.dir", "D:\\java prj");
Prof.setPreference("browser.download.folderList", 2);
Prof.setPreference("browser.helperApps.neverAsk.saveToDisk","application/zip");
WebDriver driver = new FirefoxDriver(Prof);
driver.get("http://www.bcfi.be/download/");
driver.manage().timeouts().implicitlyWait(3,TimeUnit.MINUTES);
driver.findElement(By.xpath("//*[@id='datatable']/tbody/tr[3]/td[3]/form/input")).click();
}
}
No comments:
Post a Comment