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 web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
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)