-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSystemSetup.java
More file actions
41 lines (33 loc) · 1.29 KB
/
SystemSetup.java
File metadata and controls
41 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package SeleniumPackage;
import java.io.File;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class SystemSetup {
public static WebDriver driver;
public static FirefoxProfile profile;
public static void main(String[] args) throws InterruptedException
{
SystemSetup ss = new SystemSetup();
ss.LoadFirefox();
//Uploading File..,
//TestUpload tp= new TestUpload();
//tp.uploadimage(driver);
//Downloading File..,
TestDownload td=new TestDownload();
td.testdownload(driver);
driver.close();
}
public void LoadFirefox() {
File pathToBinary = new File("C:\\Users\\sajjankumar.parjapat\\AppData\\Local\\Mozilla Firefox\\firefox.exe");
FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
profile = new FirefoxProfile();
profile.setPreference("browser.download.folderList",2);
profile.setPreference("browser.download.manager.showWhenStarting",false);
profile.setPreference("browser.download.dir","D:\\Selenuim");
profile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
driver = new FirefoxDriver(ffBinary,profile);
driver.manage().window().maximize();
}
}