I am trying to config proxy settings for the WebDriver
so I have used the following code ....
FirefoxProfile profile = new FirefoxProfile();
pro
For Mac:
In terminal of Mac, Use this command to create profile for firefox : "/Applications/Firefox.app/Contents/MacOS/firefox-bin" -p
while creating the profile, you would see the path of profile with .default, - make note of this for entering the same in code for profile path.
Code would look like this:
String profilePath="/Users/admin/Library/ApplicationSupport/Firefox/Profiles/4duhjf19.default";
System.out.println("profilePath: "+profilePath);
File checkProfile = new File(profilePath);
File[] allFolder = checkProfile.listFiles();
for (int i = 0; i < allFolder.length; i++) {
if (allFolder[i].getName().endsWith(".default")) {
profilePath = profilePath + allFolder[i].getName();
break;
}
}
FirefoxProfile firefoxprofile1 = new FirefoxProfile(new File(
profilePath));
System.out.println("profile path : " + firefoxprofile1);
driver = new FirefoxDriver(firefoxprofile1);
System.out.println("webdriver FF");
driver.manage().deleteAllCookies();