Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
document how to configure the selenium driver
Browse files Browse the repository at this point in the history
per request from #59
  • Loading branch information
flavorjones committed Sep 17, 2018
1 parent 928a477 commit 526fbf9
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ Individual projects can even select which version of `chromedriver` they want to

If you're using Bundler and Capybara in a Rails project, it's as easy as:

# Gemfile
gem "selenium-webdriver"
gem "chromedriver-helper"
``` ruby
# Gemfile
gem "selenium-webdriver"
gem "chromedriver-helper"
```

then, in your specs:
then, in your spec setup:

Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
``` ruby
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
```


## Standalone
Expand All @@ -45,6 +49,32 @@ Then just run the executable script:
which will download `chromedriver` if necessary and exec it.


# Configuration

There are some commandline options that can be sent to `chromedriver` as options to `Capybara::Selenium::Driver.new`. The supported options can be discovered by looking at the Selenium source code here:

https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/chrome/service.rb

As of this writing, the supported options are:

* `log_path`
* `url_base`
* `port_server`
* `whitelisted_ips`
* `verbose`
* `silent`

An example usage would be:

``` ruby
Capybara::Selenium::Driver.new(app, browser: :chrome,
driver_opts: {
log_path: '/tmp/chrome.log',
verbose: true
})
```


# Updating to latest `chromedriver`

You can always update to the latest version of `chromedriver`:
Expand Down

0 comments on commit 526fbf9

Please sign in to comment.