Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure the firefox binary location in Protractor?

I am successfully running Protractor tests with Chrome, specifying the path to my chrome binary using the following section in my Protractor configuration:

capabilities: {
// You can use other browsers
// like firefox, phantoms, safari, IE
'browserName': 'chrome',
"chromeOptions": {
  binary: 'C:/BuildSoftware/Chrome/Application/chrome.exe',
}

This works.

My Firefox is also installed in a non-standard location.

Is there an equivalent way to specify the binary for Firefox in the protractor config?

like image 564
Røye Avatar asked Sep 09 '14 11:09

Røye


2 Answers

UPDATED: See newer answer below: https://stackoverflow.com/a/28313583/800699

It seems you have to start the Selenium Server by yourself with custom arguments for firefox driver. See Protractor test is not starting on Firefox

More options for firefox driver (including custom firefox binary location) can be found here: https://code.google.com/p/selenium/wiki/FirefoxDriver

P/S: Browsing the firefox driver source reveals more light: https://code.google.com/p/selenium/source/browse/javascript/node/selenium-webdriver/firefox/index.js

You can try adding:

"browserName": "firefox",
"firefox_binary": "path/to/custom/firefox",
"binary_": "path/to/custom/firefox"
like image 170
6220119 Avatar answered Oct 12 '22 08:10

6220119


Protractor now supports setting the firefoxPath directly in the configuration file, when using "direct connect" (i.e., without a selenium server). See the reference config file:

https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L67

Add firefoxPath to the config file, at the top-level. It is a string that should be the path to your firefox binary. You will also need directConnect: true in the config.

For more details (handy to see all the doc that changed at once) check out the change that added this support (in Oct 2014).

like image 36
P.T. Avatar answered Oct 12 '22 08:10

P.T.