I have a setup that runs on mac fine (currently launches browser and uses chromium), what i need to do now though is get this on Ubuntu 14.04 (Amazon EC2 instance), and have or chromium running heedlessly. I have tried quite a few things now and when running a cucumber test i get the following error every time

unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform= 3.13.0-116-generic x86_64) (Selenium::WebDriver::Error::UnknownError)

This is my current setup

# Gemfile
source 'http://rubygems.org'

gem 'rake'
gem 'cucumber', "~> 2.4.0"
gem 'capybara'
gem 'rspec-expectations'
gem 'selenium-webdriver', "~> 3.0.0"
gem 'chromedriver-helper'
gem 'retriable', '~>1.4'

# env.rb

Capybara.register_driver :chrome do |app|
 chrome_binary = "/usr/bin/google-chrome"

 capabilities = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => { "binary" => chrome_binary, "args" => ['', 'disable-gpu'] })
 Capybara::Selenium::Driver.new(app, :browser => :chrome, :desired_capabilities => capabilities)

I have also installed chrome driver and xvfb

sudo apt-get install xvfb

wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver

sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

though when running which chromedriver it outputs

/home/ubuntu/.rvm/gems/[email protected]/bin/chromedriver

so i uninstalled the chromedriver-helper gem and when running /usr/bin/chromedriver i get

Starting ChromeDriver 2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac) on port 9515
Only local connections are allowed.

Is there a way to specify what chromedriver to use?

Has anybody got experience with setting this up or perhaps can spot something that i have not done?

Any help appreciated


Any help would be appreciated..!

Source link https://sqa.stackexchange.com/questions/26735/running-chrome-headless-cucumber-selenium-linux


Please enter your comment!
Please enter your name here