webdrivers 3.8.0 → 3.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f215e928688103db9bbc522a6af8058bd47f11fa48b553923d6b1a70bdb9a1ee
4
- data.tar.gz: fa1b202ad49b119ddf1ad2eedfc6dc520d25a2de3e88aabd5cc91ed4a9342d15
2
+ SHA1:
3
+ metadata.gz: 6896e06805c951acefc4a41cf1f647eb677bfb1a
4
+ data.tar.gz: 9dbc3a6e88ed3ac7e2d3c4ca885976ed236f589b
5
5
  SHA512:
6
- metadata.gz: 9c075eb9927535e331def0814676e54c1844a383ba641507ca09327b63839c2bb2691e08039c3bd3d14f590eaebfd9f09d59c4fc46098164d9a266c54803c67e
7
- data.tar.gz: 84f7e19c0a7aca6b09d3407b26dad01098027373530ac0916f6d8cf19894cdb57c91ba6345ed71c6c798d99fdb57af5297098120a8dfc2606acf71314bc0400c
6
+ metadata.gz: 95c2d9ff6ded3b07aeb40018bf4d27046d5c0a691153fee376a59fffefb46172e616bf2d712f8fe4aab08c32e3ea72b31c5b874dd11d8c54a300fd025a2bbfea
7
+ data.tar.gz: e7476ae99421fb154d8884f6815e40274d05a1a824015a4a229910167ae430f04eeed79e3f5c7c07051ff4e66e045de0e982fd519746b3d841735038f153bf43
@@ -0,0 +1,14 @@
1
+ #### Summary
2
+ Short summary of the bug or feature request.
3
+
4
+ #### Debug Info
5
+ Please provide the following information for bug reports:
6
+
7
+ * Operating system / CI Environment:
8
+ * Browser and version:
9
+
10
+ #### Expected Behavior
11
+ What you expect to happen.
12
+
13
+ #### Actual Behavior
14
+ What is actually happening: Error message, stack trace, DEBUG log if applicable (set `Webdrivers.logger.level = :DEBUG` after you require webdrivers)
data/.gitignore CHANGED
@@ -1,7 +1,7 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- chromedriver.log
6
- /.idea/
7
- coverage/
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ chromedriver.log
6
+ /.idea/
7
+ coverage/
data/.rubocop.yml CHANGED
@@ -1,19 +1,35 @@
1
- require: rubocop-rspec
2
- Metrics/LineLength:
3
- Enabled: false
4
- Metrics/MethodLength:
5
- Enabled: false
6
- Metrics/BlockLength:
7
- Enabled: false
8
- Metrics/ClassLength:
9
- Enabled: false
10
- Metrics/AbcSize:
11
- Enabled: false
12
- Metrics/CyclomaticComplexity:
13
- Enabled: false
14
- Style/Documentation:
15
- Enabled: false
16
- RSpec/ExampleLength:
17
- Enabled: false
18
- RSpec/MultipleExpectations:
19
- Enabled: false
1
+ require: rubocop-rspec
2
+
3
+ Layout/EndOfLine:
4
+ EnforcedStyle: lf
5
+
6
+ Metrics/LineLength:
7
+ Max: 120
8
+
9
+ Metrics/MethodLength:
10
+ Enabled: false
11
+
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - 'spec/**/*'
15
+
16
+ Metrics/ClassLength:
17
+ Max: 110
18
+ Exclude:
19
+ - 'lib/webdrivers/common.rb'
20
+
21
+ Metrics/AbcSize:
22
+ Exclude:
23
+ - 'lib/webdrivers/common.rb'
24
+
25
+ Metrics/CyclomaticComplexity:
26
+ Max: 8
27
+
28
+ Style/Documentation:
29
+ Enabled: false
30
+
31
+ RSpec/ExampleLength:
32
+ Enabled: false
33
+
34
+ RSpec/MultipleExpectations:
35
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,16 +1,24 @@
1
- os:
2
- - linux
3
- - osx
4
- language: ruby
5
- cache: bundler
6
- rvm:
7
- - 2.4.1
8
- - 2.5
9
- - 2.6
10
- - jruby-9.2.0.0
11
- addons:
12
- apt:
13
- packages:
14
- - chromium-browser
15
- - libgconf-2-4
16
- chrome: stable
1
+ language: ruby
2
+ cache: bundler
3
+ addons:
4
+ apt:
5
+ packages:
6
+ - chromium-browser
7
+ - libgconf-2-4
8
+ chrome: stable
9
+ script: bundle exec rake $RAKE_TASK
10
+ matrix:
11
+ include:
12
+ - rvm: 2.6.3
13
+ env: RAKE_TASK=spec
14
+ - rvm: 2.5.5
15
+ env: RAKE_TASK=spec
16
+ - rvm: 2.4.6
17
+ env: RAKE_TASK=spec
18
+ - rvm: 2.4.6
19
+ os: osx
20
+ env: RAKE_TASK=spec
21
+ - rvm: 2.4.6
22
+ env: RAKE_TASK=rubocop
23
+ - rvm: jruby-9.2.0.0
24
+ env: RAKE_TASK=spec
data/CHANGELOG.md CHANGED
@@ -1,113 +1,120 @@
1
- ### 3.8.0 (2019-04-17)
2
- * Add support for `selenium-webdriver` v4. See [#69](https://github.com/titusfortner/webdrivers/pull/69).
3
- * Remove dependency on `net_http_ssl_fix` gem. `Webdrivers.net_http_ssl_fix` now raises an exception and points to other solutions. See [#60](https://github.com/titusfortner/webdrivers/pull/60) and [#68](https://github.com/titusfortner/webdrivers/pull/68).
4
-
5
- ### 3.7.2 (2019-04-01)
6
- * Fix bugs in methods that retrieve Chrome/Chromium version. See [#43](https://github.com/titusfortner/webdrivers/pull/43) and [#52](https://github.com/titusfortner/webdrivers/issues/52).
7
- * Add workaround for a Jruby bug when retrieving Chrome version on Windows. See [#41](https://github.com/titusfortner/webdrivers/issues/41).
8
- * Update README with more information.
9
-
10
- ### 3.7.1 (2019-03-25)
11
- * Use `Selenium::WebDriver::Chrome#path` to check for a user given browser executable before defaulting to Google Chrome. Addresses [#38](https://github.com/titusfortner/webdrivers/issues/38).
12
- * Download `chromedriver` v2.46 if Chrome/Chromium version is less than 70.
13
-
14
- ### 3.7.0 (2019-03-19)
15
-
16
- * `chromedriver` version now matches the installed Chrome version. See [#32](https://github.com/titusfortner/webdrivers/pull/32).
17
-
18
- ### 3.6.0 (2018-12-30)
19
-
20
- * Put net_http_ssl_fix inside a toggle since it can cause other issues
21
-
22
- ### 3.5.2 (2018-12-16)
23
-
24
- * Use net_http_ssl_fix to address Net::HTTP issues on windows
25
-
26
- ### 3.5.1 (2018-12-16)
27
-
28
- ### 3.5.0 (2018-12-15)
29
-
30
- ### 3.5.0.beta1 (2018-12-15)
31
-
32
- * Allow version to be specified
33
-
34
- ### 3.4.3 (2018-10-22)
35
-
36
- * Fix bug with JRuby and geckodriver (thanks twalpole)
37
-
38
- ### 3.4.2 (2018-10-15)
39
-
40
- * Use chromedriver latest version
41
-
42
- ### 3.4.1 (2018-09-17)
43
-
44
- * Hardcode latest chromedriver version to 2.42 until we figure out chromedriver 70
45
-
46
- ### 3.4.0 (2018-09-07)
47
-
48
- * Allow public access to `#install_dir` and `#binary`
49
- * Allow user to set the default download directory
50
- * Improve version comparisons with use of `Gem::Version`
51
-
52
- ### 3.3.3 (2018-08-14)
53
-
54
- * Fix Geckodriver since Github changed its html again
55
-
56
- ### 3.3.2 (2018-05-04)
57
-
58
- * Fix bug with IEDriver versioning (Thanks Aleksei Gusev)
59
-
60
- ### 3.3.1 (2018-05-04)
61
-
62
- * Fix bug with MSWebdriver to fetch the correct driver instead of latest (Thanks kapoorlakshya)
63
-
64
- ### 3.3.0 (2018-04-29)
65
-
66
- * Ensures downloading correct MSWebdriver version (Thanks kapoorlakshya)
67
-
68
- ### 3.2.4 (2017-01-04)
69
-
70
- * Improve error message when unable to find the latest driver
71
-
72
- ### 3.2.3 (2017-12-12)
73
-
74
- * Fixed bug with finding geckodriver on updated Github release pages
75
-
76
- ### 3.2.2 (2017-11-20)
77
-
78
- * Fixed bug in `#untargz_file` (thanks Jake Goulding)
79
-
80
- ### 3.2.1 (2017-09-06)
81
-
82
- * Fixed Proxy support so it actually works (thanks Cheezy)
83
-
84
- ### 3.2.0 (2017-08-21)
85
-
86
- * Implemented Proxy support
87
-
88
- ### 3.1.0 (2017-08-21)
89
-
90
- * Implemented Logging functionality
91
-
92
- ### 3.0.1 (2017-08-18)
93
-
94
- * Create ~/.webdrivers directory if doesn't already exist
95
-
96
- ### 3.0.0 (2017-08-17)
97
-
98
- * Removes unnecessary downloads
99
-
100
- ### 3.0.0.beta3 (2017-08-17)
101
-
102
- * Supports Windows
103
- * Supports mswebdriver and iedriver
104
-
105
- ### 3.0.0.beta2 (2017-08-16)
106
-
107
- * Supports geckodriver on Mac and Linux
108
-
109
- ### 3.0.0.beta1 (2017-08-15)
110
-
111
- * Complete Rewrite of 2.x
112
- * Implemented with Monkey Patch not Shims
113
- * Supports chromedriver on Mac and Linux
1
+ ### 3.8.1 (2019-05-04)
2
+ * Downloads chromedriver with direct URL instead of parsing the downloads page
3
+ * Raises exception if version of Chrome does not have a known version of the driver (issue #79)
4
+ * Fixed bug warning of non-initialized variables (issue #62)
5
+ * Fixed bug with threads/processes colliding by downloading to temp files
6
+ * Fixed bug for file locking issue on Windows
7
+
8
+ ### 3.8.0 (2019-04-17)
9
+ * Add support for `selenium-webdriver` v4. See [#69](https://github.com/titusfortner/webdrivers/pull/69).
10
+ * Remove dependency on `net_http_ssl_fix` gem. `Webdrivers.net_http_ssl_fix` now raises an exception and points to other solutions. See [#60](https://github.com/titusfortner/webdrivers/pull/60) and [#68](https://github.com/titusfortner/webdrivers/pull/68).
11
+
12
+ ### 3.7.2 (2019-04-01)
13
+ * Fix bugs in methods that retrieve Chrome/Chromium version. See [#43](https://github.com/titusfortner/webdrivers/pull/43) and [#52](https://github.com/titusfortner/webdrivers/issues/52).
14
+ * Add workaround for a Jruby bug when retrieving Chrome version on Windows. See [#41](https://github.com/titusfortner/webdrivers/issues/41).
15
+ * Update README with more information.
16
+
17
+ ### 3.7.1 (2019-03-25)
18
+ * Use `Selenium::WebDriver::Chrome#path` to check for a user given browser executable before defaulting to Google Chrome. Addresses [#38](https://github.com/titusfortner/webdrivers/issues/38).
19
+ * Download `chromedriver` v2.46 if Chrome/Chromium version is less than 70.
20
+
21
+ ### 3.7.0 (2019-03-19)
22
+
23
+ * `chromedriver` version now matches the installed Chrome version. See [#32](https://github.com/titusfortner/webdrivers/pull/32).
24
+
25
+ ### 3.6.0 (2018-12-30)
26
+
27
+ * Put net_http_ssl_fix inside a toggle since it can cause other issues
28
+
29
+ ### 3.5.2 (2018-12-16)
30
+
31
+ * Use net_http_ssl_fix to address Net::HTTP issues on windows
32
+
33
+ ### 3.5.1 (2018-12-16)
34
+
35
+ ### 3.5.0 (2018-12-15)
36
+
37
+ ### 3.5.0.beta1 (2018-12-15)
38
+
39
+ * Allow version to be specified
40
+
41
+ ### 3.4.3 (2018-10-22)
42
+
43
+ * Fix bug with JRuby and geckodriver (thanks twalpole)
44
+
45
+ ### 3.4.2 (2018-10-15)
46
+
47
+ * Use chromedriver latest version
48
+
49
+ ### 3.4.1 (2018-09-17)
50
+
51
+ * Hardcode latest chromedriver version to 2.42 until we figure out chromedriver 70
52
+
53
+ ### 3.4.0 (2018-09-07)
54
+
55
+ * Allow public access to `#install_dir` and `#binary`
56
+ * Allow user to set the default download directory
57
+ * Improve version comparisons with use of `Gem::Version`
58
+
59
+ ### 3.3.3 (2018-08-14)
60
+
61
+ * Fix Geckodriver since Github changed its html again
62
+
63
+ ### 3.3.2 (2018-05-04)
64
+
65
+ * Fix bug with IEDriver versioning (Thanks Aleksei Gusev)
66
+
67
+ ### 3.3.1 (2018-05-04)
68
+
69
+ * Fix bug with MSWebdriver to fetch the correct driver instead of latest (Thanks kapoorlakshya)
70
+
71
+ ### 3.3.0 (2018-04-29)
72
+
73
+ * Ensures downloading correct MSWebdriver version (Thanks kapoorlakshya)
74
+
75
+ ### 3.2.4 (2017-01-04)
76
+
77
+ * Improve error message when unable to find the latest driver
78
+
79
+ ### 3.2.3 (2017-12-12)
80
+
81
+ * Fixed bug with finding geckodriver on updated Github release pages
82
+
83
+ ### 3.2.2 (2017-11-20)
84
+
85
+ * Fixed bug in `#untargz_file` (thanks Jake Goulding)
86
+
87
+ ### 3.2.1 (2017-09-06)
88
+
89
+ * Fixed Proxy support so it actually works (thanks Cheezy)
90
+
91
+ ### 3.2.0 (2017-08-21)
92
+
93
+ * Implemented Proxy support
94
+
95
+ ### 3.1.0 (2017-08-21)
96
+
97
+ * Implemented Logging functionality
98
+
99
+ ### 3.0.1 (2017-08-18)
100
+
101
+ * Create ~/.webdrivers directory if doesn't already exist
102
+
103
+ ### 3.0.0 (2017-08-17)
104
+
105
+ * Removes unnecessary downloads
106
+
107
+ ### 3.0.0.beta3 (2017-08-17)
108
+
109
+ * Supports Windows
110
+ * Supports mswebdriver and iedriver
111
+
112
+ ### 3.0.0.beta2 (2017-08-16)
113
+
114
+ * Supports geckodriver on Mac and Linux
115
+
116
+ ### 3.0.0.beta1 (2017-08-15)
117
+
118
+ * Complete Rewrite of 2.x
119
+ * Implemented with Monkey Patch not Shims
120
+ * Supports chromedriver on Mac and Linux
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in webdrivers.gemspec
4
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in webdrivers.gemspec
6
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,22 +1,22 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2017: Titus Fortner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017: Titus Fortner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,153 +1,154 @@
1
- # Webdrivers
2
-
3
- [![Gem Version](https://badge.fury.io/rb/webdrivers.svg)](https://badge.fury.io/rb/webdrivers)
4
- [![Build status](https://api.travis-ci.org/titusfortner/webdrivers.svg)](https://travis-ci.org/titusfortner/webdrivers)
5
-
6
- Run Selenium tests more easily with automatic installation and updates for all supported webdrivers.
7
-
8
- ## Description
9
-
10
- `webdrivers` downloads drivers and directs Selenium to use them. Currently supports:
11
-
12
- * [chromedriver](http://chromedriver.chromium.org/)
13
- * [geckodriver](https://github.com/mozilla/geckodriver)
14
- * [IEDriverServer](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver)
15
- * [MicrosoftWebDriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
16
-
17
- ## Usage
18
-
19
- In your Gemfile:
20
-
21
- `gem 'webdrivers', '~> 3.0'`
22
-
23
- In your project:
24
-
25
- ```ruby
26
- require 'webdrivers'
27
- ```
28
-
29
- The drivers will now be automatically downloaded or updated when you launch a browser
30
- through Selenium.
31
-
32
- ### Download Location
33
-
34
- The default download location is `~/.webdrivers` directory, and this is configurable:
35
-
36
- ```ruby
37
- Webdrivers.install_dir = '/webdrivers/install/dir'
38
- ```
39
-
40
- ### Version Pinning
41
-
42
- If you would like to use a specific (older or beta) version, you can specify it for each driver. Otherwise, the latest (stable)
43
- driver will be downloaded and passed to Selenium.
44
-
45
- ```ruby
46
- # Chrome
47
- Webdrivers::Chromedriver.version = '2.46'
48
-
49
- # Firefox
50
- Webdrivers::Geckodriver.version = '0.23.0'
51
-
52
- # Microsoft Internet Explorer
53
- Webdrivers::IEdriver.version = '3.14.0'
54
-
55
- # Microsoft Edge
56
- Webdrivers::MSWebdriver.version = '17134'
57
- ```
58
-
59
- You can also trigger the update in your code, but it is not required:
60
-
61
- ```ruby
62
- Webdrivers::Chromedriver.update
63
- ```
64
-
65
- ### Proxy
66
-
67
- If there is a proxy between you and the Internet then you will need to configure
68
- the gem to use the proxy. You can do this by calling the `configure` method.
69
-
70
- ````ruby
71
- Webdrivers.configure do |config|
72
- config.proxy_addr = 'myproxy_address.com'
73
- config.proxy_port = '8080'
74
- config.proxy_user = 'username'
75
- config.proxy_pass = 'password'
76
- end
77
- ````
78
-
79
- ### `SSL_connect` errors
80
-
81
- If you are getting an error like this (especially common on Windows):
82
-
83
- `SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed`
84
-
85
- Add the following to your Gemfile:
86
-
87
- ```ruby
88
- gem "net_http_ssl_fix"
89
- ```
90
-
91
- Add the following to your code:
92
-
93
- ````ruby
94
- require 'net_http_ssl_fix'
95
- ````
96
-
97
- Other solutions are documented on the RubyGems [website](https://guides.rubygems.org/ssl-certificate-update/).
98
-
99
- ### Logging
100
-
101
- The logging level can be configured for debugging purpose:
102
-
103
- ```ruby
104
- Webdrivers.logger.level = :DEBUG
105
- ```
106
-
107
- ### Browser Specific Notes
108
-
109
- #### When using Chrome/Chromium
110
-
111
- The version of `chromedriver` will depend on the version of Chrome you are using it with:
112
-
113
- * For versions >= 70, the downloaded version of `chromedriver` will match the installed version of Google Chrome. More information [here](http://chromedriver.chromium.org/downloads/version-selection).
114
- * For versions <= 69, `chromedriver` version 2.46 will be downloaded.
115
- * For beta versions, you'll have to set the desired beta version of `chromedriver` using `Webdrivers::Chromedriver.version`.
116
-
117
- The gem, by default, looks for the Google Chrome version. You can override this by providing a path to the Chromium binary:
118
-
119
- ```ruby
120
- Selenium::WebDriver::Chrome.path = '/chromium/install/path/to/binary'
121
- ```
122
-
123
- This is also required if Google Chrome is not installed in its [default location](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).
124
-
125
- #### When using Microsoft Edge
126
-
127
- After updating Microsoft Edge on Windows 10, you will need to delete the existing binary (`%USERPROFILE%/.webdrivers/MicrosoftWebDriver.exe`) to
128
- to be able to download the latest version through this gem.
129
-
130
- This is because `MicrosoftWebDriver.exe` is not backwards compatible and it does not have an argument to retrieve
131
- the current version. We work around this limitation by querying the current Edge version from the registry and
132
- fetching the corresponding binary IF a file does not already exist. If a file does exist, the gem assumes it is the
133
- expected version and skips the download process.
134
-
135
- If you continue with the outdated binary, Selenium will throw an error: `unable to connect to MicrosoftWebDriver localhost:17556`.
136
-
137
- ## Wiki
138
-
139
- Please see the [wiki](https://github.com/titusfortner/webdrivers/wiki) for solutions to commonly reported issues.
140
-
141
- ## License
142
-
143
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT),
144
- see LICENSE.txt for full details and copyright.
145
-
146
- ## Contributing
147
-
148
- Bug reports and pull requests are welcome [on GitHub](https://github.com/titusfortner/webdrivers). Run `bundle exec rake` and squash the commits in your PRs.
149
-
150
- ## Copyright
151
-
152
- Copyright (c) 2017 Titus Fortner
153
- See LICENSE for details
1
+ # Webdrivers
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/webdrivers.svg)](https://badge.fury.io/rb/webdrivers)
4
+ [![Build status](https://travis-ci.org/titusfortner/webdrivers.svg?branch=master)](https://travis-ci.org/titusfortner/webdrivers)
5
+ [![AppVeyor status](https://ci.appveyor.com/api/projects/status/github/titusfortner/webdrivers?svg=true)](https://ci.appveyor.com/project/titusfortner/webdrivers)
6
+
7
+ Run Selenium tests more easily with automatic installation and updates for all supported webdrivers.
8
+
9
+ ## Description
10
+
11
+ `webdrivers` downloads drivers and directs Selenium to use them. Currently supports:
12
+
13
+ * [chromedriver](http://chromedriver.chromium.org/)
14
+ * [geckodriver](https://github.com/mozilla/geckodriver)
15
+ * [IEDriverServer](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver)
16
+ * [MicrosoftWebDriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
17
+
18
+ ## Usage
19
+
20
+ In your Gemfile:
21
+
22
+ `gem 'webdrivers', '~> 3.0'`
23
+
24
+ In your project:
25
+
26
+ ```ruby
27
+ require 'webdrivers'
28
+ ```
29
+
30
+ The drivers will now be automatically downloaded or updated when you launch a browser
31
+ through Selenium.
32
+
33
+ ### Download Location
34
+
35
+ The default download location is `~/.webdrivers` directory, and this is configurable:
36
+
37
+ ```ruby
38
+ Webdrivers.install_dir = '/webdrivers/install/dir'
39
+ ```
40
+
41
+ ### Version Pinning
42
+
43
+ If you would like to use a specific (older or beta) version, you can specify it for each driver. Otherwise, the latest (stable)
44
+ driver will be downloaded and passed to Selenium.
45
+
46
+ ```ruby
47
+ # Chrome
48
+ Webdrivers::Chromedriver.version = '2.46'
49
+
50
+ # Firefox
51
+ Webdrivers::Geckodriver.version = '0.23.0'
52
+
53
+ # Microsoft Internet Explorer
54
+ Webdrivers::IEdriver.version = '3.14.0'
55
+
56
+ # Microsoft Edge
57
+ Webdrivers::MSWebdriver.version = '17134'
58
+ ```
59
+
60
+ You can also trigger the update in your code, but it is not required:
61
+
62
+ ```ruby
63
+ Webdrivers::Chromedriver.update
64
+ ```
65
+
66
+ ### Proxy
67
+
68
+ If there is a proxy between you and the Internet then you will need to configure
69
+ the gem to use the proxy. You can do this by calling the `configure` method.
70
+
71
+ ````ruby
72
+ Webdrivers.configure do |config|
73
+ config.proxy_addr = 'myproxy_address.com'
74
+ config.proxy_port = '8080'
75
+ config.proxy_user = 'username'
76
+ config.proxy_pass = 'password'
77
+ end
78
+ ````
79
+
80
+ ### `SSL_connect` errors
81
+
82
+ If you are getting an error like this (especially common on Windows):
83
+
84
+ `SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed`
85
+
86
+ Add the following to your Gemfile:
87
+
88
+ ```ruby
89
+ gem "net_http_ssl_fix"
90
+ ```
91
+
92
+ Add the following to your code:
93
+
94
+ ````ruby
95
+ require 'net_http_ssl_fix'
96
+ ````
97
+
98
+ Other solutions are documented on the RubyGems [website](https://guides.rubygems.org/ssl-certificate-update/).
99
+
100
+ ### Logging
101
+
102
+ The logging level can be configured for debugging purpose:
103
+
104
+ ```ruby
105
+ Webdrivers.logger.level = :DEBUG
106
+ ```
107
+
108
+ ### Browser Specific Notes
109
+
110
+ #### When using Chrome/Chromium
111
+
112
+ The version of `chromedriver` will depend on the version of Chrome you are using it with:
113
+
114
+ * For versions >= 70, the downloaded version of `chromedriver` will match the installed version of Google Chrome. More information [here](http://chromedriver.chromium.org/downloads/version-selection).
115
+ * For versions <= 69, `chromedriver` version 2.46 will be downloaded.
116
+ * For beta versions, you'll have to set the desired beta version of `chromedriver` using `Webdrivers::Chromedriver.version`.
117
+
118
+ The gem, by default, looks for the Google Chrome version. You can override this by providing a path to the Chromium binary:
119
+
120
+ ```ruby
121
+ Selenium::WebDriver::Chrome.path = '/chromium/install/path/to/binary'
122
+ ```
123
+
124
+ This is also required if Google Chrome is not installed in its [default location](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).
125
+
126
+ #### When using Microsoft Edge
127
+
128
+ After updating Microsoft Edge on Windows 10, you will need to delete the existing binary (`%USERPROFILE%/.webdrivers/MicrosoftWebDriver.exe`) to
129
+ to be able to download the latest version through this gem.
130
+
131
+ This is because `MicrosoftWebDriver.exe` is not backwards compatible and it does not have an argument to retrieve
132
+ the current version. We work around this limitation by querying the current Edge version from the registry and
133
+ fetching the corresponding binary IF a file does not already exist. If a file does exist, the gem assumes it is the
134
+ expected version and skips the download process.
135
+
136
+ If you continue with the outdated binary, Selenium will throw an error: `unable to connect to MicrosoftWebDriver localhost:17556`.
137
+
138
+ ## Wiki
139
+
140
+ Please see the [wiki](https://github.com/titusfortner/webdrivers/wiki) for solutions to commonly reported issues.
141
+
142
+ ## License
143
+
144
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT),
145
+ see LICENSE.txt for full details and copyright.
146
+
147
+ ## Contributing
148
+
149
+ Bug reports and pull requests are welcome [on GitHub](https://github.com/titusfortner/webdrivers). Run `bundle exec rake` and squash the commits in your PRs.
150
+
151
+ ## Copyright
152
+
153
+ Copyright (c) 2017 Titus Fortner
154
+ See LICENSE for details