1

Getting started with rails testing and following this tutorial.

When I run the first test with rspec spec/hello_world.rb

I get the following errors:

WARN Selenium [DEPRECATION] [:capabilities] The :capabilities parameter for Selenium::WebDriver::Chrome::Driver is deprecated. Use :options argument with an instance of Selenium::WebDriver::Chrome::Driver instead.

And

Failures:

  1. Hello World index page shows the right content Got 0 failures and 2 other errors:

    1.1) Failure/Error: visit hello_world_index_path

     TypeError:
       no implicit conversion of nil into String
     # ./spec/hello_world_spec.rb:9:in `block (3 levels) in <top (required)>'
    

    1.2) Failure/Error: @pid = Process.spawn(*@command, options)

     TypeError:
       no implicit conversion of nil into String
    

With the stack trace showing: ruby/gems/3.1.0/gems/selenium-webdriver-4.8.2/lib/selenium/webdriver/common/child_process.rb:57:in `spawn'

I am using the most up to date webdrivers and selenium-webdriver.

I am on an m1 macbook and found this solution to update my chrome-drivers but it still results in same error.

I am out of ideas now and have been unable to even start learning how to test with rails so any help would be greatly appreciated.

1 Answers1

2

Update: Fixed in 4.8.3

The error is a bug. It was reported here https://github.com/SeleniumHQ/selenium/issues/11815 and will be fixed in the next release. If you downgrade Selenium to 4.8.1 everything will work as expected.

That deprecation notice is about how capabilities are getting passed into Selenium. Unfortunately, Watir & Capybara are both passing things in with the old method so it needs to be fixed in those projects. (I probably should have gotten them fixed in the old projects before I deprecated that approach in Selenium).

If you want to avoid seeing that deprecation notice in your console, you can add this to your code:

Selenium::WebDriver.logger.ignore :capabilities
titusfortner
  • 4,099
  • 2
  • 15
  • 29
  • hi, titus, I will delete as soon as you answered. I read from your selenium document that "BiDi: * Released selenium-devtools 0.116.0 (supports CDP v85, v114, v115, v116) " Where would I find the document as to how to use this? – Rajagopalan Sep 02 '23 at 04:10
  • what we have is https://www.selenium.dev/documentation/webdriver/bidirectional/ Feel free to ask questions in official channels — https://www.selenium.dev/support/ – titusfortner Sep 02 '23 at 18:17