I am trying to config proxy settings for the WebDriver
so I have used the following code ....
FirefoxProfile profile = new FirefoxProfile();
pro
For Mac, if you installed FireFox via brew cask, just symbolic link it to /Applications.
cd /Applications
ln -s /Users/<your-username>/Applications/Firefox.app Firefox.app
This worked for me.
This kind of issue obtained because of selenium web driver fail to find the .exe files of Firefox. Please check whether C:\Program Files (x86)\Mozilla Firefox you have exe file in the location and don’t forget to set environment variable having the java jdk path. Source:- http://www.tech4crack.com/solved-cannot-find-firefox-binary-in-path/
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();
I believe you have several options:
Either specify the folder (in which your Firefox binary is) in your PATH system variable - here's how.
Or call
WebDriver driver = new FirefoxDriver(new FirefoxBinary(new File("path/to/your/firefox.exe")), profile);
I'm not sure about on a Mac, but on Windows I resolved this issue.
Make sure you are using the 32 bit version of nunit. Firefox is a 32 bit browser.
I have a 64 bit windows OS, but Firefox is a 32 bit browser. I was trying to use the 64 bit version of nunit, which was giving this "Cannot fine firefox binary in PATH" error. I resolved this by using the 32 bit version of nunit. Basically, there are two exe files in the nunit folder, nunit.exe and nunit-x86.exe. If you are getting this "Cannot fine firefox binary in PATH" error, most likely you need to use the 32 bit version of nunit - the Nunit-x86.exe.
In my case I need to move Firefox.app from /Users/username/Applications to /Applications