1

I'm trying to launch Firefox remotely on a windows machine from UNIX box using remotewebdriver.

I've tried by adding Firefox in the PATH as below:

$ echo $PATH
/cygdrive/c/Program Files (x86)/Google/Chrome/Application/:/cygdrive/c/Program Files (x86)/Mozilla Firefox/

But still the browser fails to launch as the geckodriver.exe tries to find Firefox in the windows default path.

Here is the log from selenium hub:

1486475449767 mozprofile::profile INFO Using profile path C:\cygwin64\tmp\rus
t_mozprofile.Rmyr2i85U1HV

1486475449774 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe

I also tried adding below property while launching selenium node:

-Dwebdriver.firefox.bin="/cygdrive/c/Program Files (x86)/Mozilla Firefox/"

However, the exception was thrown:

Caused by: org.openqa.selenium.WebDriverException: 'webdriver.firefox.bin' property set, but unable to locate the requested binary: /cygdrive/c/Program Files (x86)/Mozilla Firefox/.exe
.....
.....
Exception: Could not initialize class org.openqa.selenium.firefox.internal.Executable

Is there a way to provide the path to the firefox installation folder?


EDIT:

After providing parameters:

-Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.firefox.bin="firefox/firefox.exe"

The execution gets stuck at:

1486534065121 mozprofile::profile INFO Using profile path C:\cygwin64\tmp\rust_mozprofile.eqdfIaNAGjDu 1486534065135 geckodriver::marionette INFO Starting browser >C:\cygwin64\home\Administrator\firefox\firefox.exe

1486534065198 geckodriver::marionette INFO Connecting to Marionette on localhost:56702

1486534068740 Marionette INFO Listening on port 56702

ravikant
  • 415
  • 1
  • 5
  • 13

1 Answers1

0

Try escape characters and specify the .exe file:

-Dwebdriver.firefox.bin="/cygdrive/c/Program Files\ (x86)/Mozilla Firefox/firefox.exe"

voy
  • 696
  • 7
  • 14
  • Tried installing firefox in /home/Administrator/firefox and passed below args to the grid -Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.firefox.bin="firefox/firefox.exe" The execution got stuck right before launching the browser – ravikant Feb 07 '17 at 15:47
  • I've added a new questiopn [here](http://stackoverflow.com/questions/42106180/selenium-remotewebdriver-stuckbefore-launching-browser) with new issue – ravikant Feb 08 '17 at 06:37