chromedriver-helper is no longer supported. If you try to install it or upgrade to a newer version, you’ll be greeted with this announcement:
As the message suggests, if you need to test JavaScript within the confines of a Rails app, then webdrivers is how you’ll want to manage Selenium drivers. If you’ve purchased my Rails testing book, Everyday Rails Testing with RSpec, you can download an updated version from Leanpub that uses webdrivers.
This switch is a good move overall. webdrivers provides support for non-Chrome browsers, and is more actively maintained. And, from my experience, making the switch is mostly a one-line replacement. Open your Gemfile and make the swap:
Since webdrivers brings in selenium-webdriver as a dependency, I’ve been removing it from my apps’ own explicit dependencies. If you use Spring, you may need to stop it with bin/spring stop
, then run your tests as usual. Assuming things were working before with chromedriver-helper, they should continue to work using webdrivers.
The only exception I’ve found to that is on a computer where I had a dev channel version of Chrome installed. While working to upgrade the source for my book, I ran into the following failure:
At first glance, I thought my app was returning a 404 for some reason, but that didn’t make sense. After digging into the gem’s source, I found the 404 was coming from Google’s servers, attempting to download the latest ChromeDriver version from the dev channel. I was on a tight schedule, and replacing my dev channel Chrome with a standard install fixed the issue. (This may have been solved by now; I’ll dig back in and update this post accordingly as I know more.)
I’ve also read about issues using webdrivers alongside VCR. I didn’t run into these issues myself, but workarounds are now documented.
Thanks to Junichi Ito for sharing this issue with me, thanks to Mike Dalessio for his work on chromedriver-helper, and thanks to you for reading. I hope you find this information helpful.
Ruby on Rails news and tips, and other ideas and surprises from Aaron at Everyday Rails. Delivered to your inbox on no particular set schedule.