Answer the question
In order to leave comments, you need to log in
Why is Selenium Webdriver (Rails) not seeing firefox?
Hello. I want to test the interface, and for some reason selenium thinks that "/usr/bin/firefox" is not a file.
require "spec_helper"
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../config/environment", __dir__)
abort("The Rails environment is running in production mode!") if Rails.env.production?
require "rspec/rails"
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f }
require "capybara/rails"
require "selenium/webdriver"
Selenium::WebDriver::Firefox::Binary.path = "/usr/bin/firefox"
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.include FactoryBot::Syntax::Methods
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
end
which
normally gives out the path and sees firefox:
Why is that? which firefox #=> /usr/bin/firefox
Answer the question
In order to leave comments, you need to log in
Because:
[email protected]:~$ file /usr/bin/firefox
/usr/bin/firefox: symbolic link to ../lib/firefox/firefox.sh
Selenium::WebDriver::Firefox::Binary.path = "/usr/bin/firefox"
Selenium::WebDriver::Firefox::Binary.path='/usr/bin/firefox/firefox-bin'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question