selenium-webdriver 2.53.4 → 3.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +24 -18
- data/README.md +2 -3
- data/lib/selenium/server.rb +64 -68
- data/lib/selenium/webdriver.rb +5 -9
- data/lib/selenium/webdriver/chrome.rb +18 -3
- data/lib/selenium/webdriver/chrome/bridge.rb +13 -16
- data/lib/selenium/webdriver/chrome/profile.rb +7 -9
- data/lib/selenium/webdriver/chrome/service.rb +8 -84
- data/lib/selenium/webdriver/common.rb +1 -2
- data/lib/selenium/webdriver/common/action_builder.rb +28 -38
- data/lib/selenium/webdriver/common/alert.rb +7 -10
- data/lib/selenium/webdriver/common/bridge_helper.rb +10 -15
- data/lib/selenium/webdriver/common/driver.rb +19 -28
- data/lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb +0 -3
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +4 -6
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +4 -5
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +0 -3
- data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +3 -6
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -5
- data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +2 -5
- data/lib/selenium/webdriver/common/element.rb +27 -29
- data/lib/selenium/webdriver/common/error.rb +17 -20
- data/lib/selenium/webdriver/common/file_reaper.rb +3 -9
- data/lib/selenium/webdriver/common/html5/local_storage.rb +6 -8
- data/lib/selenium/webdriver/common/html5/session_storage.rb +6 -8
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +6 -15
- data/lib/selenium/webdriver/common/keyboard.rb +7 -12
- data/lib/selenium/webdriver/common/keys.rb +67 -69
- data/lib/selenium/webdriver/common/log_entry.rb +3 -4
- data/lib/selenium/webdriver/common/logs.rb +2 -4
- data/lib/selenium/webdriver/common/mouse.rb +9 -12
- data/lib/selenium/webdriver/common/navigation.rb +2 -4
- data/lib/selenium/webdriver/common/options.rb +16 -19
- data/lib/selenium/webdriver/common/platform.rb +61 -90
- data/lib/selenium/webdriver/common/port_prober.rb +1 -2
- data/lib/selenium/webdriver/common/profile_helper.rb +5 -8
- data/lib/selenium/webdriver/common/proxy.rb +58 -70
- data/lib/selenium/webdriver/common/search_context.rb +15 -19
- data/lib/selenium/webdriver/common/service.rb +127 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +5 -11
- data/lib/selenium/webdriver/common/socket_poller.rb +4 -9
- data/lib/selenium/webdriver/common/target_locator.rb +11 -13
- data/lib/selenium/webdriver/common/timeouts.rb +4 -6
- data/lib/selenium/webdriver/common/touch_action_builder.rb +2 -4
- data/lib/selenium/webdriver/common/touch_screen.rb +15 -18
- data/lib/selenium/webdriver/common/w3c_error.rb +3 -6
- data/lib/selenium/webdriver/common/wait.rb +6 -11
- data/lib/selenium/webdriver/common/window.rb +12 -15
- data/lib/selenium/webdriver/common/zipper.rb +6 -8
- data/lib/selenium/webdriver/edge.rb +18 -3
- data/lib/selenium/webdriver/edge/bridge.rb +11 -16
- data/lib/selenium/webdriver/edge/legacy_support.rb +38 -39
- data/lib/selenium/webdriver/edge/service.rb +8 -82
- data/lib/selenium/webdriver/firefox.rb +25 -6
- data/lib/selenium/webdriver/firefox/binary.rb +37 -53
- data/lib/selenium/webdriver/firefox/bridge.rb +3 -6
- data/lib/selenium/webdriver/firefox/extension.rb +4 -6
- data/lib/selenium/webdriver/firefox/extension/prefs.json +1 -10
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +8 -11
- data/lib/selenium/webdriver/firefox/profile.rb +40 -42
- data/lib/selenium/webdriver/firefox/profiles_ini.rb +8 -15
- data/lib/selenium/webdriver/firefox/service.rb +23 -79
- data/lib/selenium/webdriver/firefox/util.rb +0 -2
- data/lib/selenium/webdriver/firefox/w3c_bridge.rb +2 -4
- data/lib/selenium/webdriver/ie.rb +16 -7
- data/lib/selenium/webdriver/ie/bridge.rb +16 -23
- data/lib/selenium/webdriver/{iphone.rb → ie/service.rb} +26 -4
- data/lib/selenium/webdriver/phantomjs.rb +8 -3
- data/lib/selenium/webdriver/phantomjs/bridge.rb +9 -11
- data/lib/selenium/webdriver/phantomjs/service.rb +17 -81
- data/lib/selenium/webdriver/remote.rb +0 -2
- data/lib/selenium/webdriver/remote/bridge.rb +193 -191
- data/lib/selenium/webdriver/remote/capabilities.rb +60 -90
- data/lib/selenium/webdriver/remote/commands.rb +197 -192
- data/lib/selenium/webdriver/remote/http/common.rb +15 -13
- data/lib/selenium/webdriver/remote/http/curb.rb +5 -9
- data/lib/selenium/webdriver/remote/http/default.rb +32 -37
- data/lib/selenium/webdriver/remote/http/persistent.rb +4 -6
- data/lib/selenium/webdriver/remote/response.rb +13 -21
- data/lib/selenium/webdriver/remote/server_error.rb +1 -3
- data/lib/selenium/webdriver/remote/w3c_bridge.rb +200 -195
- data/lib/selenium/webdriver/remote/w3c_capabilities.rb +38 -46
- data/lib/selenium/webdriver/remote/w3c_commands.rb +116 -113
- data/lib/selenium/webdriver/safari.rb +23 -7
- data/lib/selenium/{client/javascript_frameworks/jquery.rb → webdriver/safari/apple_bridge.rb} +28 -9
- data/lib/selenium/webdriver/safari/browser.rb +0 -2
- data/lib/selenium/webdriver/safari/{bridge.rb → legacy_bridge.rb} +12 -9
- data/lib/selenium/webdriver/safari/options.rb +3 -4
- data/lib/selenium/webdriver/safari/resources/client.js +56 -7255
- data/lib/selenium/webdriver/safari/server.rb +18 -24
- data/lib/selenium/{client/javascript_frameworks/prototype.rb → webdriver/safari/service.rb} +27 -9
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/support/abstract_event_listener.rb +17 -2
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -3
- data/lib/selenium/webdriver/support/color.rb +55 -38
- data/lib/selenium/webdriver/{android.rb → support/escaper.rb} +19 -4
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +36 -38
- data/lib/selenium/webdriver/support/select.rb +33 -84
- data/selenium-webdriver.gemspec +23 -23
- metadata +19 -30
- data/lib/selenium-client.rb +0 -21
- data/lib/selenium/client.rb +0 -57
- data/lib/selenium/client/base.rb +0 -151
- data/lib/selenium/client/driver.rb +0 -29
- data/lib/selenium/client/errors.rb +0 -28
- data/lib/selenium/client/extensions.rb +0 -132
- data/lib/selenium/client/idiomatic.rb +0 -507
- data/lib/selenium/client/javascript_expression_builder.rb +0 -135
- data/lib/selenium/client/legacy_driver.rb +0 -1722
- data/lib/selenium/client/protocol.rb +0 -123
- data/lib/selenium/client/selenium_helper.rb +0 -49
- data/lib/selenium/rake/server_task.rb +0 -176
- data/lib/selenium/webdriver/android/bridge.rb +0 -68
- data/lib/selenium/webdriver/common/core_ext/base64.rb +0 -28
- data/lib/selenium/webdriver/common/core_ext/dir.rb +0 -61
- data/lib/selenium/webdriver/common/html5/location.rb +0 -19
- data/lib/selenium/webdriver/ie/server.rb +0 -133
- data/lib/selenium/webdriver/iphone/bridge.rb +0 -64
@@ -25,25 +25,24 @@ module Selenium
|
|
25
25
|
# server is being asked to create.
|
26
26
|
#
|
27
27
|
class W3CCapabilities
|
28
|
-
|
29
28
|
DEFAULTS = {
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
}
|
29
|
+
browser_name: '',
|
30
|
+
browser_version: :any,
|
31
|
+
platform_name: :any,
|
32
|
+
platform_version: :any,
|
33
|
+
accept_ssl_certs: false,
|
34
|
+
page_load_strategy: 'normal',
|
35
|
+
proxy: nil
|
36
|
+
}.freeze
|
38
37
|
|
39
38
|
KNOWN = [
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
]
|
39
|
+
:remote_session_id,
|
40
|
+
:xul_app_id,
|
41
|
+
:raise_accessibility_exceptions,
|
42
|
+
:rotatable,
|
43
|
+
:app_build_id,
|
44
|
+
:device
|
45
|
+
].freeze
|
47
46
|
|
48
47
|
(DEFAULTS.keys + KNOWN).each do |key|
|
49
48
|
define_method key do
|
@@ -69,28 +68,24 @@ module Selenium
|
|
69
68
|
#
|
70
69
|
|
71
70
|
class << self
|
72
|
-
|
73
71
|
def edge(opts = {})
|
74
72
|
new({
|
75
|
-
:
|
76
|
-
:
|
77
|
-
|
73
|
+
browser_name: 'MicrosoftEdge',
|
74
|
+
platform: :windows
|
75
|
+
}.merge(opts))
|
78
76
|
end
|
79
77
|
|
80
78
|
def firefox(opts = {})
|
81
79
|
opts[:browser_version] = opts.delete :version
|
82
80
|
opts[:platform_name] = opts.delete :platform
|
83
81
|
|
84
|
-
new({
|
85
|
-
:browser_name => "firefox",
|
86
|
-
:marionette => true
|
87
|
-
}.merge(opts))
|
82
|
+
new({browser_name: 'firefox'}.merge(opts))
|
88
83
|
end
|
89
84
|
|
90
85
|
alias_method :ff, :firefox
|
91
86
|
|
92
87
|
def w3c?(opts = {})
|
93
|
-
opts[:desired_capabilities].is_a?(
|
88
|
+
!opts[:desired_capabilities].is_a?(Capabilities)
|
94
89
|
end
|
95
90
|
|
96
91
|
#
|
@@ -101,16 +96,16 @@ module Selenium
|
|
101
96
|
data = data.dup
|
102
97
|
|
103
98
|
# Convert due to Remote Driver implementation
|
104
|
-
data[
|
105
|
-
data[
|
99
|
+
data['browserVersion'] = data.delete('version') if data.key? 'version'
|
100
|
+
data['platformName'] = data.delete('platform') if data.key? 'platform'
|
106
101
|
|
107
102
|
caps = new
|
108
|
-
caps.browser_name = data.delete(
|
109
|
-
caps.browser_version = data.delete(
|
110
|
-
caps.platform_name = data.delete(
|
111
|
-
caps.platform_version = data.delete(
|
112
|
-
caps.accept_ssl_certs = data.delete(
|
113
|
-
caps.page_load_strategy = data.delete(
|
103
|
+
caps.browser_name = data.delete('browserName')
|
104
|
+
caps.browser_version = data.delete('browserVersion')
|
105
|
+
caps.platform_name = data.delete('platformName')
|
106
|
+
caps.platform_version = data.delete('platformVersion')
|
107
|
+
caps.accept_ssl_certs = data.delete('acceptSslCerts')
|
108
|
+
caps.page_load_strategy = data.delete('pageLoadStrategy')
|
114
109
|
proxy = data.delete('proxy')
|
115
110
|
caps.proxy = Proxy.json_create(proxy) unless proxy.nil? || proxy.empty?
|
116
111
|
|
@@ -118,11 +113,11 @@ module Selenium
|
|
118
113
|
caps[:remote_session_id] = data.delete('webdriver.remote.sessionid')
|
119
114
|
|
120
115
|
# Obsolete capabilities returned by Remote Server
|
121
|
-
data.delete(
|
116
|
+
data.delete('javascriptEnabled')
|
122
117
|
data.delete('cssSelectorsEnabled')
|
123
118
|
|
124
119
|
# Marionette Specific
|
125
|
-
caps[:xul_app_id] = data.delete(
|
120
|
+
caps[:xul_app_id] = data.delete('XULappId')
|
126
121
|
caps[:raise_accessibility_exceptions] = data.delete('raisesAccessibilityExceptions')
|
127
122
|
caps[:rotatable] = data.delete('rotatable')
|
128
123
|
caps[:app_build_id] = data.delete('appBuildId')
|
@@ -163,12 +158,12 @@ module Selenium
|
|
163
158
|
end
|
164
159
|
|
165
160
|
def merge!(other)
|
166
|
-
if other.respond_to?(:capabilities, true) && other.capabilities.
|
161
|
+
if other.respond_to?(:capabilities, true) && other.capabilities.is_a?(Hash)
|
167
162
|
@capabilities.merge! other.capabilities
|
168
|
-
elsif other.
|
163
|
+
elsif other.is_a? Hash
|
169
164
|
@capabilities.merge! other
|
170
165
|
else
|
171
|
-
raise ArgumentError,
|
166
|
+
raise ArgumentError, 'argument should be a Hash or implement #capabilities'
|
172
167
|
end
|
173
168
|
end
|
174
169
|
|
@@ -186,7 +181,7 @@ module Selenium
|
|
186
181
|
# @api private
|
187
182
|
#
|
188
183
|
|
189
|
-
def as_json(
|
184
|
+
def as_json(*)
|
190
185
|
hash = {}
|
191
186
|
|
192
187
|
@capabilities.each do |key, value|
|
@@ -207,12 +202,12 @@ module Selenium
|
|
207
202
|
hash
|
208
203
|
end
|
209
204
|
|
210
|
-
def to_json(*
|
205
|
+
def to_json(*)
|
211
206
|
JSON.generate as_json
|
212
207
|
end
|
213
208
|
|
214
209
|
def ==(other)
|
215
|
-
return false unless other.
|
210
|
+
return false unless other.is_a? self.class
|
216
211
|
as_json == other.as_json
|
217
212
|
end
|
218
213
|
|
@@ -220,16 +215,13 @@ module Selenium
|
|
220
215
|
|
221
216
|
protected
|
222
217
|
|
223
|
-
|
224
|
-
@capabilities
|
225
|
-
end
|
218
|
+
attr_reader :capabilities
|
226
219
|
|
227
220
|
private
|
228
221
|
|
229
222
|
def camel_case(str)
|
230
|
-
str.gsub(/_([a-z])/) {
|
223
|
+
str.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
|
231
224
|
end
|
232
|
-
|
233
225
|
end # W3CCapabilities
|
234
226
|
end # Remote
|
235
227
|
end # WebDriver
|
@@ -17,116 +17,119 @@
|
|
17
17
|
# specific language governing permissions and limitations
|
18
18
|
# under the License.
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
20
|
+
module Selenium
|
21
|
+
module WebDriver
|
22
|
+
module Remote
|
23
|
+
class W3CBridge
|
24
|
+
#
|
25
|
+
# http://www.w3.org/TR/2015/WD-webdriver-20150918/#list-of-endpoints
|
26
|
+
#
|
27
|
+
|
28
|
+
#
|
29
|
+
# session handling
|
30
|
+
#
|
31
|
+
|
32
|
+
command :newSession, :post, 'session'
|
33
|
+
command :deleteSession, :delete, 'session/:session_id'
|
34
|
+
|
35
|
+
#
|
36
|
+
# basic driver
|
37
|
+
#
|
38
|
+
|
39
|
+
command :get, :post, 'session/:session_id/url'
|
40
|
+
command :getCurrentUrl, :get, 'session/:session_id/url'
|
41
|
+
command :back, :post, 'session/:session_id/back'
|
42
|
+
command :forward, :post, 'session/:session_id/forward'
|
43
|
+
command :refresh, :post, 'session/:session_id/refresh'
|
44
|
+
command :getTitle, :get, 'session/:session_id/title'
|
45
|
+
|
46
|
+
#
|
47
|
+
# window and Frame handling
|
48
|
+
#
|
49
|
+
|
50
|
+
command :getWindowHandle, :get, 'session/:session_id/window'
|
51
|
+
command :closeWindow, :delete, 'session/:session_id/window'
|
52
|
+
command :switchToWindow, :post, 'session/:session_id/window'
|
53
|
+
command :getWindowHandles, :get, 'session/:session_id/window/handles'
|
54
|
+
command :fullscreenWindow, :post, 'session/:session_id/window/fullscreen'
|
55
|
+
command :maximizeWindow, :post, 'session/:session_id/window/maximize'
|
56
|
+
command :setWindowSize, :post, 'session/:session_id/window/size'
|
57
|
+
command :getWindowSize, :get, 'session/:session_id/window/size'
|
58
|
+
command :switchToFrame, :post, 'session/:session_id/frame'
|
59
|
+
command :switchToParentFrame, :post, 'session/:session_id/frame/parent'
|
60
|
+
|
61
|
+
#
|
62
|
+
# element
|
63
|
+
#
|
64
|
+
|
65
|
+
command :findElement, :post, 'session/:session_id/element'
|
66
|
+
command :findElements, :post, 'session/:session_id/elements'
|
67
|
+
command :findChildElement, :post, 'session/:session_id/element/:id/element'
|
68
|
+
command :findChildElements, :post, 'session/:session_id/element/:id/elements'
|
69
|
+
command :getActiveElement, :get, 'session/:session_id/element/active'
|
70
|
+
command :isElementSelected, :get, 'session/:session_id/element/:id/selected'
|
71
|
+
command :getElementAttribute, :get, 'session/:session_id/element/:id/attribute/:name'
|
72
|
+
command :getElementProperty, :get, 'session/:session_id/element/:id/property/:name'
|
73
|
+
command :getElementCssValue, :get, 'session/:session_id/element/:id/css/:property_name'
|
74
|
+
command :getElementText, :get, 'session/:session_id/element/:id/text'
|
75
|
+
command :getElementTagName, :get, 'session/:session_id/element/:id/name'
|
76
|
+
command :getElementRect, :get, 'session/:session_id/element/:id/rect'
|
77
|
+
command :isElementEnabled, :get, 'session/:session_id/element/:id/enabled'
|
78
|
+
|
79
|
+
#
|
80
|
+
# document handling
|
81
|
+
#
|
82
|
+
|
83
|
+
command :getPageSource, :get, '/session/:session_id/source'
|
84
|
+
command :executeScript, :post, 'session/:session_id/execute/sync'
|
85
|
+
command :executeAsyncScript, :post, 'session/:session_id/execute/async'
|
86
|
+
|
87
|
+
#
|
88
|
+
# cookies
|
89
|
+
#
|
90
|
+
|
91
|
+
command :getAllCookies, :get, 'session/:session_id/cookie'
|
92
|
+
command :getCookie, :get, 'session/:session_id/cookie/:name'
|
93
|
+
command :addCookie, :post, 'session/:session_id/cookie'
|
94
|
+
command :deleteCookie, :delete, 'session/:session_id/cookie/:name'
|
95
|
+
|
96
|
+
#
|
97
|
+
# timeouts
|
98
|
+
#
|
99
|
+
|
100
|
+
command :setTimeout, :post, 'session/:session_id/timeouts'
|
101
|
+
|
102
|
+
#
|
103
|
+
# actions
|
104
|
+
#
|
105
|
+
|
106
|
+
command :actions, :post, 'session/:session_id/actions'
|
107
|
+
|
108
|
+
#
|
109
|
+
# Element Operations
|
110
|
+
#
|
111
|
+
|
112
|
+
command :elementClick, :post, 'session/:session_id/element/:id/click'
|
113
|
+
command :elementTap, :post, 'session/:session_id/element/:id/tap'
|
114
|
+
command :elementClear, :post, 'session/:session_id/element/:id/clear'
|
115
|
+
command :elementSendKeys, :post, 'session/:session_id/element/:id/value'
|
116
|
+
|
117
|
+
#
|
118
|
+
# alerts
|
119
|
+
#
|
120
|
+
|
121
|
+
command :dismissAlert, :post, 'session/:session_id/alert/dismiss'
|
122
|
+
command :acceptAlert, :post, 'session/:session_id/alert/accept'
|
123
|
+
command :getAlertText, :get, 'session/:session_id/alert/text'
|
124
|
+
command :sendAlertText, :post, 'session/:session_id/alert/text'
|
125
|
+
|
126
|
+
#
|
127
|
+
# screenshot
|
128
|
+
#
|
129
|
+
|
130
|
+
command :takeScreenshot, :get, 'session/:session_id/screenshot'
|
131
|
+
command :takeElementScreenshot, :get, 'session/:session_id/element/:id/screenshot'
|
132
|
+
end
|
133
|
+
end # Remote
|
134
|
+
end # WebDriver
|
135
|
+
end # Selenium
|
@@ -23,6 +23,11 @@ require 'pathname'
|
|
23
23
|
module Selenium
|
24
24
|
module WebDriver
|
25
25
|
module Safari
|
26
|
+
MISSING_TEXT = <<-ERROR.tr("\n", '').freeze
|
27
|
+
Unable to find safari extension. Please download the file from
|
28
|
+
http://www.seleniumhq.org/download/ and place it
|
29
|
+
somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/SafariDriver.
|
30
|
+
ERROR
|
26
31
|
|
27
32
|
class << self
|
28
33
|
def path=(path)
|
@@ -34,15 +39,15 @@ module Selenium
|
|
34
39
|
@path ||= (
|
35
40
|
path = case Platform.os
|
36
41
|
when :windows
|
37
|
-
Platform.find_in_program_files(
|
42
|
+
Platform.find_in_program_files('Safari\\Safari.exe')
|
38
43
|
when :macosx
|
39
|
-
|
44
|
+
'/Applications/Safari.app/Contents/MacOS/Safari'
|
40
45
|
else
|
41
|
-
Platform.find_binary(
|
46
|
+
Platform.find_binary('Safari')
|
42
47
|
end
|
43
48
|
|
44
49
|
unless File.file?(path) && File.executable?(path)
|
45
|
-
raise Error::WebDriverError,
|
50
|
+
raise Error::WebDriverError, MISSING_TEXT
|
46
51
|
end
|
47
52
|
|
48
53
|
path
|
@@ -50,10 +55,18 @@ module Selenium
|
|
50
55
|
end
|
51
56
|
|
52
57
|
def resource_path
|
53
|
-
@resource_path ||= Pathname.new(File.expand_path(
|
58
|
+
@resource_path ||= Pathname.new(File.expand_path('../safari/resources', __FILE__))
|
59
|
+
end
|
60
|
+
|
61
|
+
def driver_path=(path)
|
62
|
+
Platform.assert_executable path
|
63
|
+
@driver_path = path
|
54
64
|
end
|
55
|
-
end
|
56
65
|
|
66
|
+
def driver_path
|
67
|
+
@driver_path || '/usr/bin/safaridriver'
|
68
|
+
end
|
69
|
+
end
|
57
70
|
end # Safari
|
58
71
|
end # WebDriver
|
59
72
|
end # Selenium
|
@@ -61,5 +74,8 @@ end # Selenium
|
|
61
74
|
require 'selenium/webdriver/safari/browser'
|
62
75
|
require 'selenium/webdriver/safari/server'
|
63
76
|
require 'selenium/webdriver/safari/options'
|
64
|
-
require 'selenium/webdriver/safari/
|
77
|
+
require 'selenium/webdriver/safari/legacy_bridge'
|
78
|
+
require 'selenium/webdriver/safari/apple_bridge'
|
79
|
+
require 'selenium/webdriver/safari/service'
|
65
80
|
|
81
|
+
Selenium::WebDriver::Safari::Bridge = Selenium::WebDriver::Safari::LegacyBridge
|