question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 Bug Report

Selenium Firefox webdriver (both 3.x and 4.alpha) does not work with Ruby 3. There could be multiple causes, but the main one is that rexml is now a bundled gem

Test script or set of commands reproducing this issue

#!/usr/bin/env ruby

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'

  gem 'selenium-webdriver'
end

require 'selenium/webdriver/firefox'

Expected behavior

Script ends without errors

Actual behavior

$ ./selenium.rb 
Fetching gem metadata from https://rubygems.org/......
Resolving dependencies...
Using bundler 2.2.3
Using rubyzip 2.3.0
Using childprocess 3.0.0
Using selenium-webdriver 3.142.7
~/.rvm/gems/ruby-3.0.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox.rb:22:in `require': cannot load such file -- rexml/document (LoadError)
	from ~/.rvm/gems/ruby-3.0.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox.rb:22:in `<top (required)>'
	from selenium.rb:9:in `require'
	from selenium.rb:9:in `<main>'

Environment

OS: macOS 10.15.7 (19H114) Browser: n/a Browser version: n/a Browser Driver version: n/a Language Bindings version: Ruby 3.0 Selenium Grid version (if applicable): n/a

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
jrobersonaquentcommented, Dec 30, 2020

I monkey patched Selenium::WebDriver::Remote::Bridge and it fixed the double-splat issue for us:

module Selenium
  module WebDriver
    module Remote
      class Bridge
        class << self
          alias_method :original_handshake, :handshake

          def handshake(opts = {})
            original_handshake(**opts)
          end
        end
      end
    end
  end
end
1reaction
titusfortnercommented, Jan 13, 2021

This is now fixed in trunk, and I’m not doing another 3.x release as discussed in #9002

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ruby 3.0.0 Released
The goal of RBS is to support commonly seen patterns in Ruby programs and it allows writing advanced types including union types, method ......
Read more >
Ruby 3.0 Support · Issue #6878 · jruby/jruby - GitHub
Many specs have already been added for Ruby 2.7 and Ruby 3.0 behaviors, but there are always gaps! Please help write a complete...
Read more >
Ruby 3 is released - The list of Ruby 3 features - BigBinary Blog
Ruby 3.0 series | Ruby 3.0 is released on the Xmas 2020. ... "I hope to see Ruby help every programmer in the...
Read more >
Update 3rd party Ruby gems to support Ruby 3.0 - GitLab.org
Update 3rd party Ruby gems to support Ruby 3.0 ... The following gems currently have the Ruby version restrictions that prevent us from...
Read more >
Upgrade Ruby From 2.7 to 3.0 - FastRuby.io
Ruby 3.0 was released on December 25th 2020. We can now enjoy the great new ... now supports leading arguments. def method_missing(meth, ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found