selenium-webdriver 3.0.0.beta4.0 → 4.0.0.alpha5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +679 -0
- data/Gemfile +2 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/selenium-webdriver.rb +2 -2
- data/lib/selenium/server.rb +23 -16
- data/lib/selenium/webdriver.rb +43 -25
- data/lib/selenium/webdriver/atoms.rb +20 -1
- data/lib/selenium/webdriver/atoms/findElements.js +122 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +84 -11
- data/lib/selenium/webdriver/atoms/isDisplayed.js +100 -0
- data/lib/selenium/webdriver/chrome.rb +15 -20
- data/lib/selenium/webdriver/chrome/bridge.rb +29 -66
- data/lib/selenium/webdriver/{edge/service.rb → chrome/driver.rb} +19 -22
- data/lib/selenium/webdriver/chrome/options.rb +221 -0
- data/lib/selenium/webdriver/chrome/profile.rb +6 -7
- data/lib/selenium/webdriver/chrome/service.rb +20 -20
- data/lib/selenium/webdriver/common.rb +19 -11
- data/lib/selenium/webdriver/common/action_builder.rb +98 -246
- data/lib/selenium/webdriver/common/alert.rb +2 -7
- data/lib/selenium/webdriver/common/driver.rb +89 -51
- data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +45 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +50 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_input_devices.rb → has_debugger.rb} +12 -25
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +38 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +3 -5
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +51 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +3 -3
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +51 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +2 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +2 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +2 -2
- data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +4 -4
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +9 -3
- data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +3 -5
- data/lib/selenium/webdriver/common/element.rb +32 -10
- data/lib/selenium/webdriver/common/error.rb +103 -121
- data/lib/selenium/webdriver/common/file_reaper.rb +3 -5
- data/lib/selenium/webdriver/common/html5/local_storage.rb +2 -2
- data/lib/selenium/webdriver/common/html5/session_storage.rb +2 -2
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +3 -2
- data/lib/selenium/webdriver/common/interactions/input_device.rb +54 -0
- data/lib/selenium/webdriver/common/interactions/interaction.rb +53 -0
- data/lib/selenium/webdriver/{phantomjs.rb → common/interactions/interactions.rb} +17 -20
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +145 -0
- data/lib/selenium/webdriver/common/interactions/key_input.rb +66 -0
- data/lib/selenium/webdriver/common/interactions/none_input.rb +36 -0
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +363 -0
- data/lib/selenium/webdriver/common/interactions/pointer_input.rb +139 -0
- data/lib/selenium/webdriver/common/keys.rb +37 -15
- data/lib/selenium/webdriver/common/log_entry.rb +4 -4
- data/lib/selenium/webdriver/common/logger.rb +147 -0
- data/lib/selenium/webdriver/common/logs.rb +2 -2
- data/lib/selenium/webdriver/common/manager.rb +177 -0
- data/lib/selenium/webdriver/common/navigation.rb +2 -2
- data/lib/selenium/webdriver/common/options.rb +47 -105
- data/lib/selenium/webdriver/common/platform.rb +44 -38
- data/lib/selenium/webdriver/common/port_prober.rb +8 -19
- data/lib/selenium/webdriver/common/profile_helper.rb +13 -5
- data/lib/selenium/webdriver/common/proxy.rb +14 -8
- data/lib/selenium/webdriver/common/search_context.rb +16 -20
- data/lib/selenium/webdriver/common/service.rb +115 -30
- data/lib/selenium/webdriver/common/socket_lock.rb +12 -7
- data/lib/selenium/webdriver/common/socket_poller.rb +29 -22
- data/lib/selenium/webdriver/common/target_locator.rb +6 -6
- data/lib/selenium/webdriver/common/timeouts.rb +2 -2
- data/lib/selenium/webdriver/common/wait.rb +14 -8
- data/lib/selenium/webdriver/common/window.rb +38 -2
- data/lib/selenium/webdriver/common/zipper.rb +3 -5
- data/lib/selenium/webdriver/edge.rb +33 -20
- data/lib/selenium/webdriver/edge_chrome/bridge.rb +30 -0
- data/lib/selenium/webdriver/edge_chrome/driver.rb +38 -0
- data/lib/selenium/webdriver/{common/driver_extensions/has_touch_screen.rb → edge_chrome/options.rb} +10 -12
- data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
- data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
- data/lib/selenium/webdriver/edge_html/driver.rb +39 -0
- data/lib/selenium/webdriver/edge_html/options.rb +91 -0
- data/lib/selenium/webdriver/edge_html/service.rb +47 -0
- data/lib/selenium/webdriver/firefox.rb +24 -29
- data/lib/selenium/webdriver/firefox/bridge.rb +15 -39
- data/lib/selenium/webdriver/firefox/{util.rb → driver.rb} +13 -19
- data/lib/selenium/webdriver/firefox/extension.rb +28 -8
- data/lib/selenium/webdriver/firefox/options.rb +162 -0
- data/lib/selenium/webdriver/firefox/profile.rb +23 -82
- data/lib/selenium/webdriver/firefox/profiles_ini.rb +5 -5
- data/lib/selenium/webdriver/firefox/service.rb +18 -37
- data/lib/selenium/webdriver/ie.rb +13 -19
- data/lib/selenium/webdriver/ie/driver.rb +40 -0
- data/lib/selenium/webdriver/ie/options.rb +118 -0
- data/lib/selenium/webdriver/ie/service.rb +20 -20
- data/lib/selenium/webdriver/remote.rb +15 -17
- data/lib/selenium/webdriver/remote/bridge.rb +281 -300
- data/lib/selenium/webdriver/remote/capabilities.rb +102 -83
- data/lib/selenium/webdriver/remote/commands.rb +132 -192
- data/lib/selenium/webdriver/remote/driver.rb +52 -0
- data/lib/selenium/webdriver/remote/http/common.rb +23 -13
- data/lib/selenium/webdriver/remote/http/curb.rb +10 -7
- data/lib/selenium/webdriver/remote/http/default.rb +52 -32
- data/lib/selenium/webdriver/remote/http/persistent.rb +8 -4
- data/lib/selenium/webdriver/remote/response.rb +32 -35
- data/lib/selenium/webdriver/remote/server_error.rb +2 -2
- data/lib/selenium/webdriver/safari.rb +24 -22
- data/lib/selenium/webdriver/safari/bridge.rb +21 -21
- data/lib/selenium/webdriver/safari/driver.rb +41 -0
- data/lib/selenium/webdriver/safari/options.rb +66 -0
- data/lib/selenium/webdriver/safari/service.rb +8 -24
- data/lib/selenium/webdriver/support.rb +3 -2
- data/lib/selenium/webdriver/support/abstract_event_listener.rb +2 -2
- data/lib/selenium/webdriver/support/block_event_listener.rb +3 -3
- data/lib/selenium/webdriver/support/color.rb +13 -13
- data/lib/selenium/webdriver/support/escaper.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
- data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
- data/lib/selenium/webdriver/support/select.rb +20 -21
- data/lib/selenium/webdriver/version.rb +24 -0
- data/selenium-webdriver.gemspec +31 -17
- metadata +331 -248
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/keyboard.rb +0 -69
- data/lib/selenium/webdriver/common/mouse.rb +0 -88
- data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -81
- data/lib/selenium/webdriver/common/touch_screen.rb +0 -121
- data/lib/selenium/webdriver/common/w3c_error.rb +0 -191
- data/lib/selenium/webdriver/edge/bridge.rb +0 -76
- data/lib/selenium/webdriver/edge/legacy_support.rb +0 -117
- data/lib/selenium/webdriver/firefox/binary.rb +0 -186
- data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +0 -114
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/w3c_bridge.rb +0 -79
- data/lib/selenium/webdriver/ie/bridge.rb +0 -76
- data/lib/selenium/webdriver/phantomjs/bridge.rb +0 -65
- data/lib/selenium/webdriver/phantomjs/service.rb +0 -66
- data/lib/selenium/webdriver/remote/w3c_bridge.rb +0 -682
- data/lib/selenium/webdriver/remote/w3c_capabilities.rb +0 -228
- data/lib/selenium/webdriver/remote/w3c_commands.rb +0 -135
@@ -1,5 +1,5 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
4
|
# or more contributor license agreements. See the NOTICE file
|
5
5
|
# distributed with this work for additional information
|
@@ -20,39 +20,55 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Remote
|
23
|
+
|
23
24
|
#
|
24
25
|
# Specification of the desired and/or actual capabilities of the browser that the
|
25
26
|
# server is being asked to create.
|
26
27
|
#
|
28
|
+
|
27
29
|
class Capabilities
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
30
|
+
|
31
|
+
KNOWN = [
|
32
|
+
:browser_name,
|
33
|
+
:browser_version,
|
34
|
+
:platform_name,
|
35
|
+
:accept_insecure_certs,
|
36
|
+
:page_load_strategy,
|
37
|
+
:proxy,
|
38
|
+
:set_window_rect,
|
39
|
+
:timeouts,
|
40
|
+
:unhandled_prompt_behavior,
|
41
|
+
:strict_file_interactability,
|
42
|
+
|
43
|
+
# remote-specific
|
44
|
+
:remote_session_id,
|
45
|
+
|
46
|
+
# TODO: (AR) deprecate compatibility with OSS-capabilities
|
47
|
+
:implicit_timeout,
|
48
|
+
:page_load_timeout,
|
49
|
+
:script_timeout
|
50
|
+
].freeze
|
51
|
+
|
52
|
+
KNOWN.each do |key|
|
42
53
|
define_method key do
|
43
54
|
@capabilities.fetch(key)
|
44
55
|
end
|
45
56
|
|
57
|
+
next if key == :proxy
|
58
|
+
|
46
59
|
define_method "#{key}=" do |value|
|
47
60
|
@capabilities[key] = value
|
48
61
|
end
|
49
62
|
end
|
50
63
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
alias_method :
|
64
|
+
#
|
65
|
+
# Backward compatibility
|
66
|
+
#
|
67
|
+
|
68
|
+
alias_method :version, :browser_version
|
69
|
+
alias_method :version=, :browser_version=
|
70
|
+
alias_method :platform, :platform_name
|
71
|
+
alias_method :platform=, :platform_name=
|
56
72
|
|
57
73
|
#
|
58
74
|
# Convenience methods for the common choices.
|
@@ -61,69 +77,60 @@ module Selenium
|
|
61
77
|
class << self
|
62
78
|
def chrome(opts = {})
|
63
79
|
new({
|
64
|
-
browser_name: 'chrome'
|
65
|
-
javascript_enabled: true,
|
66
|
-
css_selectors_enabled: true
|
80
|
+
browser_name: 'chrome'
|
67
81
|
}.merge(opts))
|
68
82
|
end
|
69
83
|
|
70
84
|
def edge(opts = {})
|
71
|
-
|
85
|
+
edge_html(opts)
|
72
86
|
end
|
73
87
|
|
74
|
-
def
|
75
|
-
return W3CCapabilities.firefox(opts) unless opts[:marionette] == false
|
76
|
-
|
88
|
+
def edge_html(opts = {})
|
77
89
|
new({
|
78
|
-
browser_name: '
|
79
|
-
|
80
|
-
takes_screenshot: true,
|
81
|
-
css_selectors_enabled: true
|
90
|
+
browser_name: 'MicrosoftEdge',
|
91
|
+
platform_name: :windows
|
82
92
|
}.merge(opts))
|
83
93
|
end
|
84
94
|
|
85
|
-
def
|
95
|
+
def edge_chrome(opts = {})
|
86
96
|
new({
|
87
|
-
browser_name: '
|
97
|
+
browser_name: 'MicrosoftEdge'
|
88
98
|
}.merge(opts))
|
89
99
|
end
|
90
100
|
|
91
|
-
def
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
101
|
+
def firefox(opts = {})
|
102
|
+
opts[:browser_version] = opts.delete(:version) if opts.key?(:version)
|
103
|
+
opts[:platform_name] = opts.delete(:platform) if opts.key?(:platform)
|
104
|
+
opts[:timeouts] = {}
|
105
|
+
opts[:timeouts]['implicit'] = opts.delete(:implicit_timeout) if opts.key?(:implicit_timeout)
|
106
|
+
opts[:timeouts]['pageLoad'] = opts.delete(:page_load_timeout) if opts.key?(:page_load_timeout)
|
107
|
+
opts[:timeouts]['script'] = opts.delete(:script_timeout) if opts.key?(:script_timeout)
|
108
|
+
opts.delete(:timeouts) if opts[:timeouts].empty?
|
109
|
+
new({browser_name: 'firefox'}.merge(opts))
|
96
110
|
end
|
97
111
|
|
98
|
-
|
112
|
+
alias_method :ff, :firefox
|
113
|
+
|
114
|
+
def safari(opts = {})
|
99
115
|
new({
|
100
|
-
browser_name: '
|
101
|
-
|
102
|
-
takes_screenshot: true,
|
103
|
-
css_selectors_enabled: true,
|
104
|
-
native_events: true
|
116
|
+
browser_name: 'safari',
|
117
|
+
platform_name: :mac
|
105
118
|
}.merge(opts))
|
106
119
|
end
|
107
|
-
alias_method :ie, :internet_explorer
|
108
120
|
|
109
|
-
def
|
121
|
+
def htmlunit(opts = {})
|
110
122
|
new({
|
111
|
-
browser_name: '
|
112
|
-
javascript_enabled: true,
|
113
|
-
takes_screenshot: true,
|
114
|
-
css_selectors_enabled: true
|
123
|
+
browser_name: 'htmlunit'
|
115
124
|
}.merge(opts))
|
116
125
|
end
|
117
126
|
|
118
|
-
def
|
127
|
+
def internet_explorer(opts = {})
|
119
128
|
new({
|
120
|
-
browser_name: '
|
121
|
-
|
122
|
-
javascript_enabled: true,
|
123
|
-
takes_screenshot: true,
|
124
|
-
css_selectors_enabled: true
|
129
|
+
browser_name: 'internet explorer',
|
130
|
+
platform_name: :windows
|
125
131
|
}.merge(opts))
|
126
132
|
end
|
133
|
+
alias_method :ie, :internet_explorer
|
127
134
|
|
128
135
|
#
|
129
136
|
# @api private
|
@@ -133,15 +140,26 @@ module Selenium
|
|
133
140
|
data = data.dup
|
134
141
|
|
135
142
|
caps = new
|
136
|
-
caps.browser_name
|
137
|
-
caps.
|
138
|
-
caps.
|
139
|
-
caps.
|
140
|
-
caps.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
143
|
+
caps.browser_name = data.delete('browserName') if data.key?('browserName')
|
144
|
+
caps.browser_version = data.delete('browserVersion') if data.key?('browserVersion')
|
145
|
+
caps.platform_name = data.delete('platformName') if data.key?('platformName')
|
146
|
+
caps.accept_insecure_certs = data.delete('acceptInsecureCerts') if data.key?('acceptInsecureCerts')
|
147
|
+
caps.page_load_strategy = data.delete('pageLoadStrategy') if data.key?('pageLoadStrategy')
|
148
|
+
|
149
|
+
if data.key?('timeouts')
|
150
|
+
timeouts = data.delete('timeouts')
|
151
|
+
caps.implicit_timeout = timeouts['implicit'] if timeouts
|
152
|
+
caps.page_load_timeout = timeouts['pageLoad'] if timeouts
|
153
|
+
caps.script_timeout = timeouts['script'] if timeouts
|
154
|
+
end
|
155
|
+
|
156
|
+
if data.key?('proxy')
|
157
|
+
proxy = data.delete('proxy')
|
158
|
+
caps.proxy = Proxy.json_create(proxy) unless proxy.nil? || proxy.empty?
|
159
|
+
end
|
160
|
+
|
161
|
+
# Remote Server Specific
|
162
|
+
caps[:remote_session_id] = data.delete('webdriver.remote.sessionid') if data.key?('webdriver.remote.sessionid')
|
145
163
|
|
146
164
|
# any remaining pairs will be added as is, with no conversion
|
147
165
|
caps.merge!(data)
|
@@ -150,25 +168,20 @@ module Selenium
|
|
150
168
|
end
|
151
169
|
end
|
152
170
|
|
153
|
-
# @option :browser_name [String] required browser name
|
154
|
-
# @option :version [String] required browser version number
|
155
|
-
# @option :platform [Symbol] one of :any, :win, :mac, or :x
|
156
|
-
# @option :javascript_enabled [Boolean] does the driver have javascript enabled?
|
157
|
-
# @option :css_selectors_enabled [Boolean] does the driver support CSS selectors?
|
158
|
-
# @option :takes_screenshot [Boolean] can this driver take screenshots?
|
159
|
-
# @option :native_events [Boolean] does this driver use native events?
|
160
|
-
# @option :proxy [Selenium::WebDriver::Proxy, Hash] proxy configuration
|
161
|
-
#
|
162
|
-
# Firefox-specific options:
|
163
171
|
#
|
164
|
-
# @
|
172
|
+
# @param [Hash] opts
|
173
|
+
# @option :browser_name [String] required browser name
|
174
|
+
# @option :browser_version [String] required browser version number
|
175
|
+
# @option :platform_name [Symbol] one of :any, :win, :mac, or :x
|
176
|
+
# @option :accept_insecure_certs [Boolean] does the driver accept insecure SSL certifications?
|
177
|
+
# @option :proxy [Selenium::WebDriver::Proxy, Hash] proxy configuration
|
165
178
|
#
|
166
179
|
# @api public
|
167
180
|
#
|
168
181
|
|
169
182
|
def initialize(opts = {})
|
170
|
-
@capabilities =
|
171
|
-
self.proxy
|
183
|
+
@capabilities = opts
|
184
|
+
self.proxy = opts.delete(:proxy)
|
172
185
|
end
|
173
186
|
|
174
187
|
#
|
@@ -204,6 +217,7 @@ module Selenium
|
|
204
217
|
end
|
205
218
|
end
|
206
219
|
|
220
|
+
#
|
207
221
|
# @api private
|
208
222
|
#
|
209
223
|
|
@@ -214,11 +228,13 @@ module Selenium
|
|
214
228
|
case key
|
215
229
|
when :platform
|
216
230
|
hash['platform'] = value.to_s.upcase
|
217
|
-
when :firefox_profile
|
218
|
-
hash['firefox_profile'] = value.as_json['zip'] if value
|
219
231
|
when :proxy
|
220
|
-
|
221
|
-
|
232
|
+
if value
|
233
|
+
hash['proxy'] = value.as_json
|
234
|
+
hash['proxy']['proxyType'] &&= hash['proxy']['proxyType'].downcase
|
235
|
+
hash['proxy']['noProxy'] = hash['proxy']['noProxy'].split(', ') if hash['proxy']['noProxy'].is_a?(String)
|
236
|
+
end
|
237
|
+
when String
|
222
238
|
hash[key.to_s] = value
|
223
239
|
when Symbol
|
224
240
|
hash[camel_case(key.to_s)] = value
|
@@ -236,8 +252,10 @@ module Selenium
|
|
236
252
|
|
237
253
|
def ==(other)
|
238
254
|
return false unless other.is_a? self.class
|
255
|
+
|
239
256
|
as_json == other.as_json
|
240
257
|
end
|
258
|
+
|
241
259
|
alias_method :eql?, :==
|
242
260
|
|
243
261
|
protected
|
@@ -249,6 +267,7 @@ module Selenium
|
|
249
267
|
def camel_case(str)
|
250
268
|
str.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
|
251
269
|
end
|
270
|
+
|
252
271
|
end # Capabilities
|
253
272
|
end # Remote
|
254
273
|
end # WebDriver
|
@@ -1,5 +1,5 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
4
|
# or more contributor license agreements. See the NOTICE file
|
5
5
|
# distributed with this work for additional information
|
@@ -20,197 +20,137 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Remote
|
23
|
+
|
24
|
+
#
|
25
|
+
# https://w3c.github.io/webdriver/#endpoints
|
26
|
+
# @api private
|
27
|
+
#
|
28
|
+
|
23
29
|
class Bridge
|
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
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
command :mouseDown, :post, 'session/:session_id/buttondown'
|
149
|
-
command :mouseUp, :post, 'session/:session_id/buttonup'
|
150
|
-
command :mouseMoveTo, :post, 'session/:session_id/moveto'
|
151
|
-
command :sendModifierKeyToActiveElement, :post, 'session/:session_id/modifier'
|
152
|
-
command :sendKeysToActiveElement, :post, 'session/:session_id/keys'
|
153
|
-
|
154
|
-
#
|
155
|
-
# html 5
|
156
|
-
#
|
157
|
-
|
158
|
-
command :executeSql, :post, 'session/:session_id/execute_sql'
|
159
|
-
|
160
|
-
command :getLocation, :get, 'session/:session_id/location'
|
161
|
-
command :setLocation, :post, 'session/:session_id/location'
|
162
|
-
|
163
|
-
command :getAppCache, :get, 'session/:session_id/application_cache'
|
164
|
-
command :getAppCacheStatus, :get, 'session/:session_id/application_cache/status'
|
165
|
-
command :clearAppCache, :delete, 'session/:session_id/application_cache/clear'
|
166
|
-
|
167
|
-
command :getNetworkConnection, :get, 'session/:session_id/network_connection'
|
168
|
-
command :setNetworkConnection, :post, 'session/:session_id/network_connection'
|
169
|
-
|
170
|
-
command :getLocalStorageItem, :get, 'session/:session_id/local_storage/key/:key'
|
171
|
-
command :removeLocalStorageItem, :delete, 'session/:session_id/local_storage/key/:key'
|
172
|
-
command :getLocalStorageKeys, :get, 'session/:session_id/local_storage'
|
173
|
-
command :setLocalStorageItem, :post, 'session/:session_id/local_storage'
|
174
|
-
command :clearLocalStorage, :delete, 'session/:session_id/local_storage'
|
175
|
-
command :getLocalStorageSize, :get, 'session/:session_id/local_storage/size'
|
176
|
-
|
177
|
-
command :getSessionStorageItem, :get, 'session/:session_id/session_storage/key/:key'
|
178
|
-
command :removeSessionStorageItem, :delete, 'session/:session_id/session_storage/key/:key'
|
179
|
-
command :getSessionStorageKeys, :get, 'session/:session_id/session_storage'
|
180
|
-
command :setSessionStorageItem, :post, 'session/:session_id/session_storage'
|
181
|
-
command :clearSessionStorage, :delete, 'session/:session_id/session_storage'
|
182
|
-
command :getSessionStorageSize, :get, 'session/:session_id/session_storage/size'
|
183
|
-
|
184
|
-
#
|
185
|
-
# ime
|
186
|
-
#
|
187
|
-
|
188
|
-
command :imeGetAvailableEngines, :get, 'session/:session_id/ime/available_engines'
|
189
|
-
command :imeGetActiveEngine, :get, 'session/:session_id/ime/active_engine'
|
190
|
-
command :imeIsActivated, :get, 'session/:session_id/ime/activated'
|
191
|
-
command :imeDeactivate, :post, 'session/:session_id/ime/deactivate'
|
192
|
-
command :imeActivateEngine, :post, 'session/:session_id/ime/activate'
|
193
|
-
|
194
|
-
#
|
195
|
-
# touch
|
196
|
-
#
|
197
|
-
|
198
|
-
command :touchSingleTap, :post, 'session/:session_id/touch/click'
|
199
|
-
command :touchDoubleTap, :post, 'session/:session_id/touch/doubleclick'
|
200
|
-
command :touchLongPress, :post, 'session/:session_id/touch/longclick'
|
201
|
-
command :touchDown, :post, 'session/:session_id/touch/down'
|
202
|
-
command :touchUp, :post, 'session/:session_id/touch/up'
|
203
|
-
command :touchMove, :post, 'session/:session_id/touch/move'
|
204
|
-
command :touchScroll, :post, 'session/:session_id/touch/scroll'
|
205
|
-
command :touchFlick, :post, 'session/:session_id/touch/flick'
|
206
|
-
|
207
|
-
#
|
208
|
-
# logs
|
209
|
-
#
|
210
|
-
|
211
|
-
command :getAvailableLogTypes, :get, 'session/:session_id/log/types'
|
212
|
-
command :getLog, :post, 'session/:session_id/log'
|
213
|
-
end
|
30
|
+
COMMANDS = {
|
31
|
+
status: [:get, 'status'],
|
32
|
+
|
33
|
+
#
|
34
|
+
# session handling
|
35
|
+
#
|
36
|
+
|
37
|
+
new_session: [:post, 'session'],
|
38
|
+
delete_session: [:delete, 'session/:session_id'],
|
39
|
+
|
40
|
+
#
|
41
|
+
# basic driver
|
42
|
+
#
|
43
|
+
|
44
|
+
get: [:post, 'session/:session_id/url'],
|
45
|
+
get_current_url: [:get, 'session/:session_id/url'],
|
46
|
+
back: [:post, 'session/:session_id/back'],
|
47
|
+
forward: [:post, 'session/:session_id/forward'],
|
48
|
+
refresh: [:post, 'session/:session_id/refresh'],
|
49
|
+
get_title: [:get, 'session/:session_id/title'],
|
50
|
+
|
51
|
+
#
|
52
|
+
# window and Frame handling
|
53
|
+
#
|
54
|
+
|
55
|
+
get_window_handle: [:get, 'session/:session_id/window'],
|
56
|
+
new_window: [:post, 'session/:session_id/window/new'],
|
57
|
+
close_window: [:delete, 'session/:session_id/window'],
|
58
|
+
switch_to_window: [:post, 'session/:session_id/window'],
|
59
|
+
get_window_handles: [:get, 'session/:session_id/window/handles'],
|
60
|
+
fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],
|
61
|
+
minimize_window: [:post, 'session/:session_id/window/minimize'],
|
62
|
+
maximize_window: [:post, 'session/:session_id/window/maximize'],
|
63
|
+
set_window_size: [:post, 'session/:session_id/window/size'],
|
64
|
+
get_window_size: [:get, 'session/:session_id/window/size'],
|
65
|
+
set_window_position: [:post, 'session/:session_id/window/position'],
|
66
|
+
get_window_position: [:get, 'session/:session_id/window/position'],
|
67
|
+
set_window_rect: [:post, 'session/:session_id/window/rect'],
|
68
|
+
get_window_rect: [:get, 'session/:session_id/window/rect'],
|
69
|
+
switch_to_frame: [:post, 'session/:session_id/frame'],
|
70
|
+
switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
|
71
|
+
|
72
|
+
#
|
73
|
+
# element
|
74
|
+
#
|
75
|
+
|
76
|
+
find_element: [:post, 'session/:session_id/element'],
|
77
|
+
find_elements: [:post, 'session/:session_id/elements'],
|
78
|
+
find_child_element: [:post, 'session/:session_id/element/:id/element'],
|
79
|
+
find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
|
80
|
+
get_active_element: [:get, 'session/:session_id/element/active'],
|
81
|
+
is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
|
82
|
+
get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
|
83
|
+
get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
|
84
|
+
get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
|
85
|
+
get_element_text: [:get, 'session/:session_id/element/:id/text'],
|
86
|
+
get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
|
87
|
+
get_element_rect: [:get, 'session/:session_id/element/:id/rect'],
|
88
|
+
is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],
|
89
|
+
|
90
|
+
#
|
91
|
+
# document handling
|
92
|
+
#
|
93
|
+
|
94
|
+
get_page_source: [:get, 'session/:session_id/source'],
|
95
|
+
execute_script: [:post, 'session/:session_id/execute/sync'],
|
96
|
+
execute_async_script: [:post, 'session/:session_id/execute/async'],
|
97
|
+
|
98
|
+
#
|
99
|
+
# cookies
|
100
|
+
#
|
101
|
+
|
102
|
+
get_all_cookies: [:get, 'session/:session_id/cookie'],
|
103
|
+
get_cookie: [:get, 'session/:session_id/cookie/:name'],
|
104
|
+
add_cookie: [:post, 'session/:session_id/cookie'],
|
105
|
+
delete_cookie: [:delete, 'session/:session_id/cookie/:name'],
|
106
|
+
delete_all_cookies: [:delete, 'session/:session_id/cookie'],
|
107
|
+
|
108
|
+
#
|
109
|
+
# timeouts
|
110
|
+
#
|
111
|
+
|
112
|
+
set_timeout: [:post, 'session/:session_id/timeouts'],
|
113
|
+
|
114
|
+
#
|
115
|
+
# actions
|
116
|
+
#
|
117
|
+
|
118
|
+
actions: [:post, 'session/:session_id/actions'],
|
119
|
+
release_actions: [:delete, 'session/:session_id/actions'],
|
120
|
+
|
121
|
+
#
|
122
|
+
# Element Operations
|
123
|
+
#
|
124
|
+
|
125
|
+
element_click: [:post, 'session/:session_id/element/:id/click'],
|
126
|
+
element_tap: [:post, 'session/:session_id/element/:id/tap'],
|
127
|
+
element_clear: [:post, 'session/:session_id/element/:id/clear'],
|
128
|
+
element_send_keys: [:post, 'session/:session_id/element/:id/value'],
|
129
|
+
|
130
|
+
#
|
131
|
+
# alerts
|
132
|
+
#
|
133
|
+
|
134
|
+
dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],
|
135
|
+
accept_alert: [:post, 'session/:session_id/alert/accept'],
|
136
|
+
get_alert_text: [:get, 'session/:session_id/alert/text'],
|
137
|
+
send_alert_text: [:post, 'session/:session_id/alert/text'],
|
138
|
+
|
139
|
+
#
|
140
|
+
# screenshot
|
141
|
+
#
|
142
|
+
|
143
|
+
take_screenshot: [:get, 'session/:session_id/screenshot'],
|
144
|
+
take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],
|
145
|
+
|
146
|
+
#
|
147
|
+
# server extensions
|
148
|
+
#
|
149
|
+
|
150
|
+
upload_file: [:post, 'session/:session_id/se/file']
|
151
|
+
}.freeze
|
152
|
+
|
153
|
+
end # Bridge
|
214
154
|
end # Remote
|
215
155
|
end # WebDriver
|
216
156
|
end # Selenium
|