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
@@ -20,7 +20,6 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Error
|
23
|
-
|
24
23
|
class WebDriverError < StandardError; end
|
25
24
|
class UnsupportedOperationError < WebDriverError; end
|
26
25
|
|
@@ -36,7 +35,7 @@ module Selenium
|
|
36
35
|
# parameters.
|
37
36
|
#
|
38
37
|
|
39
|
-
class NoSuchElementError < WebDriverError; end
|
38
|
+
class NoSuchElementError < WebDriverError; end # 7
|
40
39
|
|
41
40
|
#
|
42
41
|
# A request to switch to a frame could not be satisfied because the
|
@@ -46,27 +45,26 @@ module Selenium
|
|
46
45
|
class NoSuchFrameError < WebDriverError; end # 8
|
47
46
|
class UnknownCommandError < WebDriverError; end # 9
|
48
47
|
|
49
|
-
|
50
48
|
#
|
51
49
|
# Indicates that a reference to an element is now "stale" - the element
|
52
50
|
# no longer appears in the DOM of the page.
|
53
51
|
#
|
54
52
|
|
55
|
-
class StaleElementReferenceError < WebDriverError; end
|
53
|
+
class StaleElementReferenceError < WebDriverError; end # 10
|
56
54
|
|
57
55
|
#
|
58
56
|
# Raised to indicate that although an element is present on the DOM,
|
59
57
|
# it is not visible, and so is not able to be interacted with.
|
60
58
|
#
|
61
59
|
|
62
|
-
class ElementNotVisibleError < WebDriverError; end
|
60
|
+
class ElementNotVisibleError < WebDriverError; end # 11
|
63
61
|
|
64
62
|
#
|
65
63
|
# Raised when an interaction could not be performed because the element
|
66
64
|
# is in an invalid state (e.g. attempting to click a disabled element).
|
67
65
|
#
|
68
66
|
|
69
|
-
class InvalidElementStateError < WebDriverError; end
|
67
|
+
class InvalidElementStateError < WebDriverError; end # 12
|
70
68
|
|
71
69
|
#
|
72
70
|
# An unknown server-side error occurred while processing the command.
|
@@ -109,30 +107,30 @@ module Selenium
|
|
109
107
|
# the current URL.
|
110
108
|
#
|
111
109
|
|
112
|
-
class InvalidCookieDomainError < WebDriverError; end
|
110
|
+
class InvalidCookieDomainError < WebDriverError; end # 24
|
113
111
|
|
114
112
|
#
|
115
113
|
# Raised when a driver fails to set a cookie.
|
116
114
|
#
|
117
115
|
|
118
|
-
class UnableToSetCookieError < WebDriverError; end
|
116
|
+
class UnableToSetCookieError < WebDriverError; end # 25
|
119
117
|
|
120
118
|
#
|
121
119
|
# Raised when an alert dialog is present that has not been dealt with.
|
122
120
|
#
|
123
|
-
class UnhandledAlertError < WebDriverError; end
|
121
|
+
class UnhandledAlertError < WebDriverError; end # 26
|
124
122
|
|
125
123
|
#
|
126
124
|
# Indicates that a user has tried to access an alert when one is not present.
|
127
125
|
#
|
128
126
|
|
129
|
-
class NoAlertPresentError < WebDriverError; end
|
127
|
+
class NoAlertPresentError < WebDriverError; end # 27
|
130
128
|
|
131
129
|
#
|
132
130
|
# A script did not complete before its timeout expired.
|
133
131
|
#
|
134
132
|
|
135
|
-
class ScriptTimeOutError < WebDriverError; end
|
133
|
+
class ScriptTimeOutError < WebDriverError; end # 28
|
136
134
|
|
137
135
|
#
|
138
136
|
# The coordinates provided to an interactions operation are invalid.
|
@@ -146,7 +144,7 @@ module Selenium
|
|
146
144
|
# the machine.
|
147
145
|
#
|
148
146
|
|
149
|
-
class IMENotAvailableError < WebDriverError; end
|
147
|
+
class IMENotAvailableError < WebDriverError; end # 30
|
150
148
|
|
151
149
|
#
|
152
150
|
# Indicates that activating an IME engine has failed.
|
@@ -158,23 +156,23 @@ module Selenium
|
|
158
156
|
# Argument was an invalid selector (e.g. XPath/CSS).
|
159
157
|
#
|
160
158
|
|
161
|
-
class InvalidSelectorError < WebDriverError; end
|
159
|
+
class InvalidSelectorError < WebDriverError; end # 32
|
162
160
|
|
163
161
|
#
|
164
162
|
# A new session could not be created.
|
165
163
|
#
|
166
164
|
|
167
|
-
class SessionNotCreatedError < WebDriverError; end
|
165
|
+
class SessionNotCreatedError < WebDriverError; end # 33
|
168
166
|
|
169
167
|
#
|
170
168
|
# Indicates that the target provided to the actions #move method is
|
171
169
|
# invalid, e.g. outside of the bounds of the window.
|
172
170
|
#
|
173
171
|
|
174
|
-
class MoveTargetOutOfBoundsError < WebDriverError; end
|
172
|
+
class MoveTargetOutOfBoundsError < WebDriverError; end # 34
|
175
173
|
|
176
174
|
# @api private
|
177
|
-
|
175
|
+
ERRORS = [
|
178
176
|
IndexOutOfBoundsError, # 1
|
179
177
|
NoCollectionError, # 2
|
180
178
|
NoStringError, # 3
|
@@ -209,20 +207,19 @@ module Selenium
|
|
209
207
|
InvalidSelectorError, # 32
|
210
208
|
SessionNotCreatedError, # 33
|
211
209
|
MoveTargetOutOfBoundsError # 34
|
212
|
-
]
|
210
|
+
].freeze
|
213
211
|
|
214
212
|
class << self
|
215
213
|
def for_code(code)
|
216
214
|
return if [nil, 0].include? code
|
217
|
-
return
|
215
|
+
return ERRORS[code - 1] if code.is_a? Fixnum
|
218
216
|
|
219
217
|
klass_name = code.split(' ').map(&:capitalize).join
|
220
|
-
Error.const_get("#{klass_name.gsub('Error','')}Error")
|
218
|
+
Error.const_get("#{klass_name.gsub('Error', '')}Error")
|
221
219
|
rescue NameError
|
222
220
|
WebDriverError
|
223
221
|
end
|
224
222
|
end
|
225
|
-
|
226
223
|
end # Error
|
227
224
|
end # WebDriver
|
228
225
|
end # Selenium
|
@@ -19,21 +19,16 @@
|
|
19
19
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
|
-
|
23
22
|
#
|
24
23
|
# @api private
|
25
24
|
#
|
26
25
|
|
27
26
|
module FileReaper
|
28
|
-
|
29
27
|
class << self
|
30
|
-
|
31
|
-
@reap = bool
|
32
|
-
end
|
28
|
+
attr_writer :reap
|
33
29
|
|
34
30
|
def reap?
|
35
|
-
@reap =
|
36
|
-
!!@reap
|
31
|
+
@reap = defined?(@reap) ? @reap : true
|
37
32
|
end
|
38
33
|
|
39
34
|
def tmp_files
|
@@ -67,7 +62,6 @@ module Selenium
|
|
67
62
|
|
68
63
|
# we *do* want child process reaping, so not using Platform.exit_hook here.
|
69
64
|
at_exit { reap! }
|
70
|
-
|
71
65
|
end # FileReaper
|
72
66
|
end # WebDriver
|
73
|
-
end # Selenium
|
67
|
+
end # Selenium
|
@@ -20,7 +20,6 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module HTML5
|
23
|
-
|
24
23
|
class LocalStorage
|
25
24
|
include SharedWebStorage
|
26
25
|
|
@@ -32,29 +31,28 @@ module Selenium
|
|
32
31
|
end
|
33
32
|
|
34
33
|
def [](key)
|
35
|
-
@bridge.
|
34
|
+
@bridge.local_storage_item key
|
36
35
|
end
|
37
36
|
|
38
37
|
def []=(key, value)
|
39
|
-
@bridge.
|
38
|
+
@bridge.local_storage_item key, value
|
40
39
|
end
|
41
40
|
|
42
41
|
def delete(key)
|
43
|
-
@bridge.
|
42
|
+
@bridge.remove_local_storage_item key
|
44
43
|
end
|
45
44
|
|
46
45
|
def clear
|
47
|
-
@bridge.
|
46
|
+
@bridge.clear_local_storage
|
48
47
|
end
|
49
48
|
|
50
49
|
def size
|
51
|
-
@bridge.
|
50
|
+
@bridge.local_storage_size
|
52
51
|
end
|
53
52
|
|
54
53
|
def keys
|
55
|
-
@bridge.
|
54
|
+
@bridge.local_storage_keys.reverse
|
56
55
|
end
|
57
|
-
|
58
56
|
end # LocalStorage
|
59
57
|
end # HTML5
|
60
58
|
end # WebDriver
|
@@ -20,33 +20,32 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module HTML5
|
23
|
-
|
24
23
|
class SessionStorage
|
25
24
|
include Enumerable
|
26
25
|
include SharedWebStorage
|
27
26
|
|
28
27
|
def [](key)
|
29
|
-
@bridge.
|
28
|
+
@bridge.session_storage_item key
|
30
29
|
end
|
31
30
|
|
32
31
|
def []=(key, value)
|
33
|
-
@bridge.
|
32
|
+
@bridge.session_storage_item key, value
|
34
33
|
end
|
35
34
|
|
36
35
|
def delete(key)
|
37
|
-
@bridge.
|
36
|
+
@bridge.remove_session_storage_item key
|
38
37
|
end
|
39
38
|
|
40
39
|
def clear
|
41
|
-
@bridge.
|
40
|
+
@bridge.clear_session_storage
|
42
41
|
end
|
43
42
|
|
44
43
|
def size
|
45
|
-
@bridge.
|
44
|
+
@bridge.session_storage_size
|
46
45
|
end
|
47
46
|
|
48
47
|
def keys
|
49
|
-
@bridge.
|
48
|
+
@bridge.session_storage_keys.reverse
|
50
49
|
end
|
51
50
|
|
52
51
|
#
|
@@ -56,7 +55,6 @@ module Selenium
|
|
56
55
|
def initialize(bridge)
|
57
56
|
@bridge = bridge
|
58
57
|
end
|
59
|
-
|
60
58
|
end # SessionStorage
|
61
59
|
end # HTML5
|
62
60
|
end # WebDriver
|
@@ -20,7 +20,6 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module HTML5
|
23
|
-
|
24
23
|
module SharedWebStorage
|
25
24
|
include Enumerable
|
26
25
|
|
@@ -30,31 +29,23 @@ module Selenium
|
|
30
29
|
alias_method :member?, :key?
|
31
30
|
alias_method :has_key?, :key?
|
32
31
|
|
33
|
-
def fetch(key
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
if block_given?
|
39
|
-
yield key
|
40
|
-
else
|
41
|
-
# should be KeyError, but it's 1.9-specific
|
42
|
-
raise IndexError, "missing key #{key.inspect}"
|
43
|
-
end
|
32
|
+
def fetch(key)
|
33
|
+
return self[key] if key? key
|
34
|
+
return yield(key) if block_given?
|
35
|
+
raise KeyError, "missing key #{key.inspect}"
|
44
36
|
end
|
45
37
|
|
46
38
|
def empty?
|
47
|
-
|
39
|
+
to_a.empty?
|
48
40
|
end
|
49
41
|
|
50
|
-
def each
|
42
|
+
def each
|
51
43
|
return enum_for(:each) unless block_given?
|
52
44
|
|
53
45
|
keys.each do |k|
|
54
46
|
yield k, self[k]
|
55
47
|
end
|
56
48
|
end
|
57
|
-
|
58
49
|
end # SharedWebStorage
|
59
50
|
end # HTML5
|
60
51
|
end # WebDriver
|
@@ -19,19 +19,17 @@
|
|
19
19
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
|
-
|
23
22
|
#
|
24
23
|
# @api private
|
25
24
|
# @see ActionBuilder
|
26
25
|
|
27
26
|
class Keyboard
|
28
|
-
|
29
27
|
def initialize(bridge)
|
30
28
|
@bridge = bridge
|
31
29
|
end
|
32
30
|
|
33
31
|
def send_keys(*keys)
|
34
|
-
@bridge.
|
32
|
+
@bridge.send_keys_to_active_element Keys.encode(keys)
|
35
33
|
end
|
36
34
|
|
37
35
|
#
|
@@ -43,7 +41,7 @@ module Selenium
|
|
43
41
|
def press(key)
|
44
42
|
assert_modifier key
|
45
43
|
|
46
|
-
@bridge.
|
44
|
+
@bridge.send_keys_to_active_element Keys.encode([key])
|
47
45
|
end
|
48
46
|
|
49
47
|
#
|
@@ -55,20 +53,17 @@ module Selenium
|
|
55
53
|
def release(key)
|
56
54
|
assert_modifier key
|
57
55
|
|
58
|
-
@bridge.
|
56
|
+
@bridge.send_keys_to_active_element Keys.encode([key])
|
59
57
|
end
|
60
58
|
|
61
59
|
private
|
62
60
|
|
63
|
-
MODIFIERS = [:control, :shift, :alt, :command, :meta]
|
61
|
+
MODIFIERS = [:control, :shift, :alt, :command, :meta].freeze
|
64
62
|
|
65
63
|
def assert_modifier(key)
|
66
|
-
|
67
|
-
|
68
|
-
"#{key.inspect} is not a modifier key, expected one of #{MODIFIERS.inspect}"
|
69
|
-
end
|
64
|
+
return if MODIFIERS.include? key
|
65
|
+
raise ArgumentError, "#{key.inspect} is not a modifier key, expected one of #{MODIFIERS.inspect}"
|
70
66
|
end
|
71
|
-
|
72
67
|
end # Keyboard
|
73
68
|
end # WebDriver
|
74
|
-
end
|
69
|
+
end # Selenium
|
@@ -20,85 +20,84 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Keys
|
23
|
-
|
24
23
|
#
|
25
24
|
# @see Element#send_keys
|
26
25
|
# @see http://www.google.com.au/search?&q=unicode+pua&btnG=Search
|
27
26
|
#
|
28
27
|
|
29
28
|
KEYS = {
|
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
|
-
}
|
29
|
+
null: "\ue000",
|
30
|
+
cancel: "\ue001",
|
31
|
+
help: "\ue002",
|
32
|
+
backspace: "\ue003",
|
33
|
+
tab: "\ue004",
|
34
|
+
clear: "\ue005",
|
35
|
+
return: "\ue006",
|
36
|
+
enter: "\ue007",
|
37
|
+
shift: "\ue008",
|
38
|
+
left_shift: "\ue008",
|
39
|
+
control: "\ue009",
|
40
|
+
left_control: "\ue009",
|
41
|
+
alt: "\ue00A",
|
42
|
+
left_alt: "\ue00A",
|
43
|
+
pause: "\ue00B",
|
44
|
+
escape: "\ue00C",
|
45
|
+
space: "\ue00D",
|
46
|
+
page_up: "\ue00E",
|
47
|
+
page_down: "\ue00F",
|
48
|
+
end: "\ue010",
|
49
|
+
home: "\ue011",
|
50
|
+
left: "\ue012",
|
51
|
+
arrow_left: "\ue012",
|
52
|
+
up: "\ue013",
|
53
|
+
arrow_up: "\ue013",
|
54
|
+
right: "\ue014",
|
55
|
+
arrow_right: "\ue014",
|
56
|
+
down: "\ue015",
|
57
|
+
arrow_down: "\ue015",
|
58
|
+
insert: "\ue016",
|
59
|
+
delete: "\ue017",
|
60
|
+
semicolon: "\ue018",
|
61
|
+
equals: "\ue019",
|
62
|
+
numpad0: "\ue01A",
|
63
|
+
numpad1: "\ue01B",
|
64
|
+
numpad2: "\ue01C",
|
65
|
+
numpad3: "\ue01D",
|
66
|
+
numpad4: "\ue01E",
|
67
|
+
numpad5: "\ue01F",
|
68
|
+
numpad6: "\ue020",
|
69
|
+
numpad7: "\ue021",
|
70
|
+
numpad8: "\ue022",
|
71
|
+
numpad9: "\ue023",
|
72
|
+
multiply: "\ue024",
|
73
|
+
add: "\ue025",
|
74
|
+
separator: "\ue026",
|
75
|
+
subtract: "\ue027",
|
76
|
+
decimal: "\ue028",
|
77
|
+
divide: "\ue029",
|
78
|
+
f1: "\ue031",
|
79
|
+
f2: "\ue032",
|
80
|
+
f3: "\ue033",
|
81
|
+
f4: "\ue034",
|
82
|
+
f5: "\ue035",
|
83
|
+
f6: "\ue036",
|
84
|
+
f7: "\ue037",
|
85
|
+
f8: "\ue038",
|
86
|
+
f9: "\ue039",
|
87
|
+
f10: "\ue03A",
|
88
|
+
f11: "\ue03B",
|
89
|
+
f12: "\ue03C",
|
90
|
+
meta: "\ue03D",
|
91
|
+
command: "\ue03D" # alias
|
92
|
+
}.freeze
|
95
93
|
|
96
94
|
#
|
97
95
|
# @api private
|
98
96
|
#
|
99
97
|
|
100
98
|
def self.[](key)
|
101
|
-
KEYS[key]
|
99
|
+
return KEYS[key] if KEYS[key]
|
100
|
+
raise Error::UnsupportedOperationError, "no such key #{key.inspect}"
|
102
101
|
end
|
103
102
|
|
104
103
|
#
|
@@ -111,7 +110,7 @@ module Selenium
|
|
111
110
|
when Symbol
|
112
111
|
Keys[arg]
|
113
112
|
when Array
|
114
|
-
arg = arg.map { |e| e.
|
113
|
+
arg = arg.map { |e| e.is_a?(Symbol) ? Keys[e] : e }.join
|
115
114
|
arg << Keys[:null]
|
116
115
|
|
117
116
|
arg
|
@@ -120,7 +119,6 @@ module Selenium
|
|
120
119
|
end
|
121
120
|
end
|
122
121
|
end
|
123
|
-
|
124
122
|
end # Keys
|
125
123
|
end # WebDriver
|
126
124
|
end # Selenium
|