selenium: [πŸ› Bug]: Selenium Manager not working on FreeBSD

What happened?

I have selenium-webdriver 4.15.0 installed in a Rails application. I have RSpec configured to use :selenium, which I understand to mean firefox/geckodriver, not chromedriver:

RSpec.configure do |config|
  config.before(:each, type: :system) do
    driver = :selenium
    driven_by(driver)
  end
end

When I remove the selenium cache, and re-run my system spec, a new chromedriver is downloaded instead of the geckodriver.

> tree ~/.cache/selenium
/Users/gd/.cache/selenium
β”œβ”€β”€ chromedriver
β”‚Β Β  └── mac-arm64
β”‚Β Β      └── 119.0.6045.105
β”‚Β Β          └── chromedriver
└── se-metadata.json

4 directories, 2 files

> rm -rf ~/.cache/selenium

> tree ~/.cache/selenium
/Users/gd/.cache/selenium  [error opening dir]

0 directories, 0 files

When I run this spec Chrome opens, even though I configured my RSpec for Firefox:

> be rspec spec/system/home_spec.rb
.

Finished in 4.49 seconds (files took 2.95 seconds to load)
1 example, 0 failures

At this point selenium-webdriver has reinstalled chromedriver even though I configured my RSpec for geckodriver:

> tree ~/.cache/selenium
/Users/gd/.cache/selenium
β”œβ”€β”€ chromedriver
β”‚Β Β  └── mac-arm64
β”‚Β Β      └── 119.0.6045.105
β”‚Β Β          └── chromedriver
└── se-metadata.json

4 directories, 2 files

How do I get selenium-webdriver to download and use geckodriver instead of chromedriver?

How can we reproduce the issue?

Make a Rails app and configure it to use geckodriver.  Please follow the example above.

Relevant log output

I have no logs, all output is shown above.

Operating System

macOS 14.0

Selenium version

selenium-webdriver 4.15.0

What are the browser(s) and version(s) where you see this issue?

Chrome 119

What are the browser driver(s) and version(s) where you see this issue?

chromedriver 119

Are you using Selenium Grid?

no

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

This is why for as much as I like Ruby, I get really frustrated with the Rails approach…

    driven_by(driver)

is calling

RSpec::Rails::SystemExampleGroup#driven_by

which calls from actionpack:

ActionDispatch::SystemTestCase#driven_by

which defaults to:

    def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400], options: {}, &capabilities)
      driver_options = { using: using, screen_size: screen_size, options: options }

      self.driver = SystemTesting::Driver.new(driver, **driver_options, &capabilities)
    end

Turn on Selenium::WebDriver.logger.level = :debug and it should show where the request for Chrome is coming from.