# WebDriverError

**URL:** <https://discuss.circleci.com/t/webdrivererror/19109>\
**Category:** Programming Languages\
**Tags:** rails\
**Created:** [December 31, 2017, 5:43am UTC](https://discuss.circleci.com/t/webdrivererror/19109 "2017-12-31T05:43:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Awlter](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/awlter/32/10246_2.png) [@Awlter](https://discuss.circleci.com/u/Awlter)\
**Post date:** [December 31, 2017, 5:43am UTC](https://discuss.circleci.com/t/webdrivererror/19109/1 "2017-12-31T05:43:32Z")

</div>

My code passes all tests on local environment but won’t pass test on CircleCI

```auto
Failures:

  1) User registers invalid personal info and declined card
     Failure/Error: visit register_path
     Selenium::WebDriver::Error::WebDriverError:
       unable to connect to chromedriver 127.0.0.1:9515
     # ./spec/features/user_registers_spec.rb:5:in `block (2 levels) in <top (required)>'

```

Something wrong with selenium-webdriver on CircleCI?

this is my Gemfile

```auto
group :test do
  gem 'database_cleaner', '1.4.1'
  gem 'shoulda-matchers', '2.7.0'
  gem 'vcr', '3.0.3'
  gem 'webmock'
  gem 'capybara'
  gem 'capybara-email'
  gem 'selenium-webdriver'
end

```

I installed `chromedriver` using brew, do I need to set up Circle yml file?

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [December 31, 2017, 12:02pm UTC](https://discuss.circleci.com/t/webdrivererror/19109/2 "2017-12-31T12:02:19Z")

</div>

Are you using Circle 1.0 or 2.0? What config file are you using? At a guess you’d need to ensure that Selenium, Chrome and the ChromeDriver is on that box, and I imagine a config file is the way to do it.

Don’t forget you can run a build with SSH and try running your tests manually - if they don’t work, you can `apt-get install` stuff and then try again - it makes debugging a whole lot easier.

---

<div class="post-metadata">

**Author:** ![Awlter](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/awlter/32/10246_2.png) [@Awlter](https://discuss.circleci.com/u/Awlter)\
**Post date:** [December 31, 2017, 12:24pm UTC](https://discuss.circleci.com/t/webdrivererror/19109/3 "2017-12-31T12:24:20Z")

</div>

Thanks Halfer

I am using 1.0

this is my circle.yml file now. After this error, I added the `dependencies` part at the [bottom](https://gist.github.com/vtno/386f0c9a0fa8dc26b816b3383b8f37f1), but I am still facing the same issue.

```auto
machine:
  ruby:
    version: 2.1.2
  environment:
    STRIPE_PUBLISHABLE_KEY: 
    STRIPE_SECRET_KEY: 
deployment:
  production:
    branch: master
    commands:
      - git fetch --unshallow
      - heroku maintenance:on --app xxx
      - heroku pg:backups capture --app xxx
      - git push git@heroku.com:walterflix.git $CIRCLE_SHA1:refs/heads/master
      - heroku run rake db:migrate --app xxx
      - heroku maintenance:off --app xxx
  staging:
    branch: staging
    commands:
      - git fetch --unshallow
      - heroku maintenance:on --app xxx-staging
      - git push git@heroku.com:xxx-staging.git $CIRCLE_SHA1:refs/heads/master
      - heroku run rake db:migrate --app xxx-staging
      - heroku maintenance:off --app xxx-staging
  dependencies:
    pre:
      # install chrome
      - wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/
      - sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
      - sudo apt-get -f install -y
      - sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
      - sudo rm /usr/local/bin/chromedriver
      # install chromedriver
      - wget -N http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip -P ~/
      - unzip ~/chromedriver_linux64.zip -d ~/
      - rm ~/chromedriver_linux64.zip
      - sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
      - sudo chown root:root /usr/local/bin/chromedriver
      - sudo chmod 0755 /usr/local/bin/chromedriver

```

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [December 31, 2017, 12:26pm UTC](https://discuss.circleci.com/t/webdrivererror/19109/4 "2017-12-31T12:26:56Z")

</div>

OK. Fail a build and debug via SSH? See if there are any logs left by Selenium or Chrome etc first. Then try launching Selenium in the foreground to see if it starts, etc.

---

<div class="post-metadata">

**Author:** ![Awlter](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/awlter/32/10246_2.png) [@Awlter](https://discuss.circleci.com/u/Awlter)\
**Post date:** [December 31, 2017, 12:28pm UTC](https://discuss.circleci.com/t/webdrivererror/19109/5 "2017-12-31T12:28:05Z")

</div>

Sorry Halfer, I am new to this field,

I am not sure what should I do exactly based on your advice right now 🙂

But it didn’t fail to build or didn’t break at least, the errors are still the same as I posted…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:32am UTC](https://discuss.circleci.com/t/webdrivererror/19109/6 "2018-06-18T11:32:50Z")

</div>

Closed on June 18, 2018, 11:32am UTC


