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
Try adding below code :
Additionally you need to add geckodriver as higher version of firfox do not support without geckodriver
Download geckodriver from below URL :-
https://github.com/mozilla/geckodriver/releases
You also need to add path of geckodrover as below:
refer :
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
Also refer :-
https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings
The java code which is working for me is as below: