UPDATE September 22, 2018: Just set the BROWSER environment variable!

  • Still can’t launch Firefox from Windows Subystem From Linux without a Selenium server and some hacks that nobody has w working (Chrome works though)
The problem with browser testing in WSL is that it relies on opening and controlling a web browser, and browsers don’t work on WSL at present as it deliberately doesn’t include X Windows or some other GUI manager - it’s meant to be command line after all. So while you can apt-get firefox, trying to actually run it isn’t going to work.


For Firefox (incomplete)

Install geckodriver on Windows. Note that the modern webdriver for Firefox is now known as Marionette, but that, if I understand correctly, the old webdriver is used for remote connections such as the one we're setting up.

Try something similar to the Chrome code below, but with :firefox instead of :chrome

Get errors such as 'Selenium::WebDriver::Error::UnknownError: The path to the driver executable must be set by the webdriver.gecko.driver system property' and try Chrome instead

  • Oh well maybe I’ll eventually find the time to make it work with Firefox!
  • In the meantime I wrote open-day-in-browser.rb which only works on Mac and not on WSL! Someday!

Leave a comment on github