0

I m using the below code for downloading file, but after running the script finally i got the windown alert to save the file, how do i save the file in a desktop/specific folder

package Inbox;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;

public class Downloadfile {
    public static void main(String[] args) {
        FirefoxProfile p1 = new FirefoxProfile();
        p1.setPreference("browser.helperApps.neverAsk.SaveToDisk", "application/java_archive");
        WebDriver f1 = new FirefoxDriver(p1);
        f1.get("http://www.seleniumhq.org/download/");
        f1.findElement(By.linkText("3.6.0")).click();
        f1.switchTo().alert().dismiss();
    }
}
Juan Carlos Mendoza
  • 5,736
  • 7
  • 25
  • 50
Prakash Mohanraj
  • 21
  • 1
  • 1
  • 4

0 Answers0