Read more

Use a special version of Chrome for selenium (and another for your everyday work)

Christoph Beck
May 10, 2012Software engineer

Sometimes you need a special version of chrome because it has some features you need for testing, like in this card. You do not need to use that Version apart from tests, because you can tweek selenium to use a special version that you set in your environment:

# features/support/chrome.rb
require "selenium/webdriver"

Capybara.register_driver :chrome320x480 do |app|
  
  if driver_path = ENV["CHROME_SELENIUM_BINARY_PATH"]
    Selenium::WebDriver::Chrome.path = driver_path
  end
  
  Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can use this for tests with a special chrome versions as well, you can have several - see this card

Don't forget to set the environmet variable before running tests if you use the code above:

bash$ export CHROME_SELENIUM_BINARY_PATH='/Applications/ChromeBETAforTests.app/Contents/MacOS/Google Chrome'
bash$ cucumber
Posted by Christoph Beck to makandra dev (2012-05-10 14:36)