Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am beginner to webdriver. I have setup all configurations. I am using firefox 27.0.1 version with selenium jar files 2.40.0. I have written code to open firefox browser with a URL. I am unable to run the code and got the below error. Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be Mac. It seems i should specify the firefox path to run the code. I tried to find the location on my mac. All i get is /Users/sathiyarengarajan/Library/Application Support/Firefox/Profiles. Tell me how to get the exact path on mac machine.

share|improve this question
add comment

2 Answers 2

The typical location of FF is /Users/username/Applications/Firefox

To confirm the location right click on a FF shortcut and select "Get info". The dialog box displays.

share|improve this answer
1  
I tried using Get info. Still I am only able to get the same above. I tried even Firefox help->troubleshoot information->Application Basics->Profile folder->show it in Finder. Any help to get the exact location would be helpful –  sathiya Mar 3 at 17:06
    
Why don't you just search the HD for Firefox? Use the search in Finder. –  Merch Mar 3 at 17:12
    
I tried. I got /Users/sathiyarengarajan/Downloads/Firefox 27.0.1.dmg. But still it didnt help. I uninstalled the firefox application. Once firefox is downloaded, i copied the firefox to the applications folder. Now I no need to set firefox path for selenium. Now things work –  sathiya Mar 4 at 11:06
    
No you should be good now, the applications folder is Selemiums default location for Firefox. –  Merch Mar 4 at 18:09
add comment

Not quite the same problem, but since I found this answer when googling, I'm providing my solution here too.

I'm trying to find the firefox executable to execute it from scripts like cucumber / selenium tests without hardcoding the path. Here's what I do:

Find it with Spotlight

firefox_paths = %x[mdfind "kMDItemFSName = Firefox.app"]
firefox_path = firefox_paths.split('\n').first.chomp
firefox_executable_path = File.join(firefox_path, '/Contents/MacOS/firefox')

Selenium::WebDriver::Firefox::Binary.path=firefox_executable_path

Another way would be to dump launch services database and grep it out there

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump \
  | grep -n7 org.mozilla.firefox \
  | grep path: \
  | awk '{ print($3) }'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.