How to set path for Firefox Binary in Rails when using c9?

Viewed 2158

For those who don't know, c9 is an online IDE that uses the cloud. So I’m trying to use FireFox with Watir and the error I’m getting is

"Could not find Firefox binary (os=linux). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path="

When I check the file path for FireFox on my PC it’s This PC/Windows(C:)/Program Files/Mozilla FireFox

This is my code which I am using

def save
    require 'watir'
    require 'firefox'

    @browser = Watir::Browser.new :firefox
    @browser.goto "https://kroger.softcoin.com/programs/kroger/digital_coupons/?origin=DigitalCoupons&banner=Smiths#contentBox"

    @browser.div(id: "contentBox").wait_until(&:present?).text

    # Could not find Firefox binary (os=linux). 
    # Make sure Firefox is installed or set the path manually with 
    # Selenium::WebDriver::Firefox::Binary.path=
    # ThisPC:WindowsC:ProgramFiles:MozillaFireFox

    @products = @browser.divs

end
1 Answers
Related