Selenium: Deprecation warning for driver_path

Created on 21 Apr 2019  路  5Comments  路  Source: SeleniumHQ/selenium

馃悰 Bug Report

When I execute bundle exec rspec and I have at least one expectation written I got:

WARN Selenium [DEPRECATION] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.
WARN Selenium [DEPRECATION] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.

To Reproduce

You can clone my repo and reproduce the bug by yourself: https://github.com/ChidaCompany/dockerized-rails-stack/tree/warn/selenium-webdriver

Just make sure you do everything within the branch warn/selenium-webdriver:

$ git clone [email protected]:ChidaCompany/dockerized-rails-stack.git
$ git fetch
$ git checkout warn/selenium-webdriver
$ docker-compose build
$ docker-compose run web rails db:create db:migrate
$ docker-compose up
$ docker exec -it rails bash
# within rails container bash
$ bundle exec rspec

Expected behavior

Specs should run without any warning

Test script or set of commands reproducing this issue

bundle exec rspec

Environment

OS: dockerized linux
Browser: N/A
Browser version: N/A
Browser Driver version: N/A
Language Bindings version: N/A
Selenium Grid version (if applicable): N/A

Most helpful comment

Today I got the same issue and the reason of that was a gem called chromedriver-helper in Gemfile, I just removed this gem and after I ran this command: bundle install

All 5 comments

Specs should run without any warning

The code you are using has been deprecated as of version 3.141.592 and will be removed in the future. See: https://github.com/SeleniumHQ/selenium/blob/master/rb/CHANGES#L66

The warning message states what you need to use instead.

Ok, sure. It should fix itself then (my Gemfile is pointing to master)

But I'm not using your library in any way. Why is it showing me that warning?

Also I'm not "using" any code. It is just there in my Gemfile so I don't know why that warning is appearing if I'm not using it

Today I got the same issue and the reason of that was a gem called chromedriver-helper in Gemfile, I just removed this gem and after I ran this command: bundle install

If your code is using selenium, perhaps with the Watir gem, use the Webdriver gem instead of chromedriver-helper now.
gem 'webdrivers', '~> 3.0'

Was this page helpful?
0 / 5 - 0 ratings