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
|
@@ -50,7 +50,7 @@ module Selenium
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def valid_type?(type)
|
53
|
-
type_to_values.
|
53
|
+
type_to_values.key? type
|
54
54
|
end
|
55
55
|
end # HasNetworkConnection
|
56
56
|
end # DriverExtensions
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
+
# or more contributor license agreements. See the NOTICE file
|
5
|
+
# distributed with this work for additional information
|
6
|
+
# regarding copyright ownership. The SFC licenses this file
|
7
|
+
# to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance
|
9
|
+
# with the License. You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Selenium
|
21
|
+
module WebDriver
|
22
|
+
module DriverExtensions
|
23
|
+
module HasPermissions
|
24
|
+
|
25
|
+
#
|
26
|
+
# Returns permissions.
|
27
|
+
#
|
28
|
+
# @return [Hash]
|
29
|
+
#
|
30
|
+
|
31
|
+
def permissions
|
32
|
+
@bridge.permissions
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# Sets permissions.
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# driver.permissions = {'getUserMedia' => true}
|
40
|
+
#
|
41
|
+
# @param [Hash<Symbol, Boolean>] permissions
|
42
|
+
#
|
43
|
+
|
44
|
+
def permissions=(permissions)
|
45
|
+
@bridge.permissions = permissions
|
46
|
+
end
|
47
|
+
|
48
|
+
end # HasPermissions
|
49
|
+
end # DriverExtensions
|
50
|
+
end # WebDriver
|
51
|
+
end # Selenium
|
@@ -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
|
@@ -25,12 +25,12 @@ module Selenium
|
|
25
25
|
|
26
26
|
module DriverExtensions
|
27
27
|
module Rotatable
|
28
|
-
ORIENTATIONS = [
|
28
|
+
ORIENTATIONS = %i[landscape portrait].freeze
|
29
29
|
|
30
30
|
#
|
31
31
|
# Change the screen orientation
|
32
32
|
#
|
33
|
-
# @param [:landscape, :portrait]
|
33
|
+
# @param [:landscape, :portrait] orientation
|
34
34
|
#
|
35
35
|
# @api public
|
36
36
|
#
|
@@ -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
|
@@ -32,6 +32,12 @@ module Selenium
|
|
32
32
|
#
|
33
33
|
|
34
34
|
def save_screenshot(png_path)
|
35
|
+
extension = File.extname(png_path).downcase
|
36
|
+
if extension != '.png'
|
37
|
+
WebDriver.logger.warn "name used for saved screenshot does not match file type. "\
|
38
|
+
"It should end with .png extension",
|
39
|
+
id: :screenshot
|
40
|
+
end
|
35
41
|
File.open(png_path, 'wb') { |f| f << screenshot_as(:png) }
|
36
42
|
end
|
37
43
|
|
@@ -48,7 +54,7 @@ module Selenium
|
|
48
54
|
when :base64
|
49
55
|
bridge.screenshot
|
50
56
|
when :png
|
51
|
-
bridge.screenshot.
|
57
|
+
bridge.screenshot.unpack1('m')
|
52
58
|
else
|
53
59
|
raise Error::UnsupportedOperationError, "unsupported format: #{format.inspect}"
|
54
60
|
end
|
@@ -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
|
@@ -50,9 +50,7 @@ module Selenium
|
|
50
50
|
#
|
51
51
|
|
52
52
|
def file_detector=(detector)
|
53
|
-
unless detector.nil? || detector.respond_to?(:call)
|
54
|
-
raise ArgumentError, 'detector must respond to #call'
|
55
|
-
end
|
53
|
+
raise ArgumentError, 'detector must respond to #call' unless detector.nil? || detector.respond_to?(:call)
|
56
54
|
|
57
55
|
bridge.file_detector = detector
|
58
56
|
end
|
@@ -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,6 +20,8 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
class Element
|
23
|
+
ELEMENT_KEY = 'element-6066-11e4-a52e-4f735466cecf'
|
24
|
+
|
23
25
|
include SearchContext
|
24
26
|
|
25
27
|
#
|
@@ -34,7 +36,7 @@ module Selenium
|
|
34
36
|
end
|
35
37
|
|
36
38
|
def inspect
|
37
|
-
format '
|
39
|
+
format '#<%<class>s:0x%<hash>x id=%<id>s>', class: self.class, hash: hash * 2, id: @id.inspect
|
38
40
|
end
|
39
41
|
|
40
42
|
def ==(other)
|
@@ -108,16 +110,26 @@ module Selenium
|
|
108
110
|
#
|
109
111
|
# class, readonly
|
110
112
|
#
|
111
|
-
# @param [String]
|
112
|
-
#
|
113
|
-
# @return [String,nil]
|
114
|
-
# attribute value
|
113
|
+
# @param [String] name attribute name
|
114
|
+
# @return [String, nil] attribute value
|
115
115
|
#
|
116
116
|
|
117
117
|
def attribute(name)
|
118
118
|
bridge.element_attribute self, name
|
119
119
|
end
|
120
120
|
|
121
|
+
#
|
122
|
+
# Get the value of a the given property with the same name of the element. If the value is not
|
123
|
+
# set, nil is returned.
|
124
|
+
#
|
125
|
+
# @param [String] name property name
|
126
|
+
# @return [String, nil] property value
|
127
|
+
#
|
128
|
+
|
129
|
+
def property(name)
|
130
|
+
bridge.element_property self, name
|
131
|
+
end
|
132
|
+
|
121
133
|
#
|
122
134
|
# Get the text content of this element
|
123
135
|
#
|
@@ -131,7 +143,7 @@ module Selenium
|
|
131
143
|
#
|
132
144
|
# Send keystrokes to this element
|
133
145
|
#
|
134
|
-
# @param [String, Symbol, Array]
|
146
|
+
# @param [String, Symbol, Array] args keystrokes to send
|
135
147
|
#
|
136
148
|
# Examples:
|
137
149
|
#
|
@@ -188,7 +200,7 @@ module Selenium
|
|
188
200
|
#
|
189
201
|
|
190
202
|
def displayed?
|
191
|
-
bridge.element_displayed?
|
203
|
+
bridge.element_displayed? self
|
192
204
|
end
|
193
205
|
|
194
206
|
#
|
@@ -225,6 +237,16 @@ module Selenium
|
|
225
237
|
bridge.element_location @id
|
226
238
|
end
|
227
239
|
|
240
|
+
#
|
241
|
+
# Get the dimensions and coordinates of this element.
|
242
|
+
#
|
243
|
+
# @return [WebDriver::Rectangle]
|
244
|
+
#
|
245
|
+
|
246
|
+
def rect
|
247
|
+
bridge.element_rect @id
|
248
|
+
end
|
249
|
+
|
228
250
|
#
|
229
251
|
# Determine an element's location on the screen once it has been scrolled into view.
|
230
252
|
#
|
@@ -292,7 +314,7 @@ module Selenium
|
|
292
314
|
#
|
293
315
|
|
294
316
|
def as_json(*)
|
295
|
-
@id.is_a?(Hash) ? @id : {
|
317
|
+
@id.is_a?(Hash) ? @id : {ELEMENT_KEY => @id}
|
296
318
|
end
|
297
319
|
|
298
320
|
private
|
@@ -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,206 +20,188 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Error
|
23
|
+
|
24
|
+
#
|
25
|
+
# Returns exception from its string representation.
|
26
|
+
# @param [String, nil] error
|
27
|
+
#
|
28
|
+
|
29
|
+
def self.for_error(error)
|
30
|
+
return if error.nil?
|
31
|
+
|
32
|
+
klass_name = error.split(' ').map(&:capitalize).join.sub(/Error$/, '')
|
33
|
+
const_get("#{klass_name}Error", false)
|
34
|
+
rescue NameError
|
35
|
+
WebDriverError
|
36
|
+
end
|
37
|
+
|
23
38
|
class WebDriverError < StandardError; end
|
24
|
-
class UnsupportedOperationError < WebDriverError; end
|
25
39
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
class
|
31
|
-
class NoSuchDriverError < WebDriverError; end # 6
|
40
|
+
#
|
41
|
+
# An element could not be located on the page using the given search parameters.
|
42
|
+
#
|
43
|
+
|
44
|
+
class NoSuchElementError < WebDriverError; end
|
32
45
|
|
33
46
|
#
|
34
|
-
#
|
35
|
-
# parameters.
|
47
|
+
# A command to switch to a frame could not be satisfied because the frame could not be found.
|
36
48
|
#
|
37
49
|
|
38
|
-
class
|
50
|
+
class NoSuchFrameError < WebDriverError; end
|
39
51
|
|
40
52
|
#
|
41
|
-
# A
|
42
|
-
# frame could not be found.
|
53
|
+
# A command could not be executed because the remote end is not aware of it.
|
43
54
|
#
|
44
55
|
|
45
|
-
class
|
46
|
-
class UnknownCommandError < WebDriverError; end # 9
|
56
|
+
class UnknownCommandError < WebDriverError; end
|
47
57
|
|
48
58
|
#
|
49
|
-
#
|
50
|
-
# no longer appears in the DOM of the page.
|
59
|
+
# A command failed because the referenced element is no longer attached to the DOM.
|
51
60
|
#
|
52
61
|
|
53
|
-
class StaleElementReferenceError < WebDriverError; end
|
62
|
+
class StaleElementReferenceError < WebDriverError; end
|
54
63
|
|
55
64
|
#
|
56
|
-
#
|
57
|
-
#
|
65
|
+
# The target element is in an invalid state, rendering it impossible to interact with, for
|
66
|
+
# example if you click a disabled element.
|
58
67
|
#
|
59
68
|
|
60
|
-
class
|
69
|
+
class InvalidElementStateError < WebDriverError; end
|
61
70
|
|
62
71
|
#
|
63
|
-
#
|
64
|
-
# is in an invalid state (e.g. attempting to click a disabled element).
|
72
|
+
# An unknown error occurred in the remote end while processing the command.
|
65
73
|
#
|
66
74
|
|
67
|
-
class
|
75
|
+
class UnknownError < WebDriverError; end
|
68
76
|
|
69
77
|
#
|
70
|
-
# An
|
78
|
+
# An error occurred while executing JavaScript supplied by the user.
|
71
79
|
#
|
72
80
|
|
73
|
-
class
|
74
|
-
class ExpectedError < WebDriverError; end # 14
|
81
|
+
class JavascriptError < WebDriverError; end
|
75
82
|
|
76
83
|
#
|
77
|
-
# An
|
84
|
+
# An operation did not complete before its timeout expired.
|
78
85
|
#
|
79
86
|
|
80
|
-
class
|
81
|
-
class NoSuchDocumentError < WebDriverError; end # 16
|
87
|
+
class TimeoutError < WebDriverError; end
|
82
88
|
|
83
89
|
#
|
84
|
-
#
|
90
|
+
# A command to switch to a window could not be satisfied because
|
91
|
+
# the window could not be found.
|
85
92
|
#
|
86
93
|
|
87
|
-
class
|
88
|
-
class NoScriptResultError < WebDriverError; end # 18
|
94
|
+
class NoSuchWindowError < WebDriverError; end
|
89
95
|
|
90
96
|
#
|
91
|
-
# An
|
97
|
+
# An illegal attempt was made to set a cookie under a different domain than the current page.
|
92
98
|
#
|
93
99
|
|
94
|
-
class
|
95
|
-
class NoSuchCollectionError < WebDriverError; end # 20
|
100
|
+
class InvalidCookieDomainError < WebDriverError; end
|
96
101
|
|
97
102
|
#
|
98
|
-
#
|
103
|
+
# A command to set a cookie's value could not be satisfied.
|
99
104
|
#
|
100
105
|
|
101
|
-
class
|
102
|
-
class NullPointerError < WebDriverError; end # 22
|
103
|
-
class NoSuchWindowError < WebDriverError; end # 23
|
106
|
+
class UnableToSetCookieError < WebDriverError; end
|
104
107
|
|
105
108
|
#
|
106
|
-
#
|
107
|
-
# the current URL.
|
109
|
+
# An attempt was made to operate on a modal dialog when one was not open:
|
108
110
|
#
|
109
111
|
|
110
|
-
class
|
112
|
+
class NoSuchAlertError < WebDriverError; end
|
111
113
|
|
112
114
|
#
|
113
|
-
#
|
115
|
+
# A script did not complete before its timeout expired.
|
114
116
|
#
|
115
117
|
|
116
|
-
class
|
118
|
+
class ScriptTimeoutError < WebDriverError; end
|
117
119
|
|
118
120
|
#
|
119
|
-
#
|
121
|
+
# Argument was an invalid selector.
|
120
122
|
#
|
121
|
-
|
123
|
+
|
124
|
+
class InvalidSelectorError < WebDriverError; end
|
122
125
|
|
123
126
|
#
|
124
|
-
#
|
127
|
+
# A new session could not be created.
|
125
128
|
#
|
126
129
|
|
127
|
-
class
|
130
|
+
class SessionNotCreatedError < WebDriverError; end
|
128
131
|
|
129
132
|
#
|
130
|
-
#
|
133
|
+
# The target for mouse interaction is not in the browser's viewport and cannot be brought
|
134
|
+
# into that viewport.
|
131
135
|
#
|
132
136
|
|
133
|
-
class
|
137
|
+
class MoveTargetOutOfBoundsError < WebDriverError; end
|
134
138
|
|
135
139
|
#
|
136
|
-
#
|
140
|
+
# A command could not be completed because the element is not pointer or keyboard
|
141
|
+
# interactable.
|
137
142
|
#
|
138
143
|
|
139
|
-
class
|
144
|
+
class ElementNotInteractableError < WebDriverError; end
|
140
145
|
|
141
146
|
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
# the machine.
|
147
|
+
# A command could not be completed because TLS certificate is expired
|
148
|
+
# or invalid.
|
145
149
|
#
|
146
150
|
|
147
|
-
class
|
151
|
+
class InsecureCertificateError < WebDriverError; end
|
148
152
|
|
149
153
|
#
|
150
|
-
#
|
154
|
+
# The arguments passed to a command are either invalid or malformed.
|
151
155
|
#
|
152
156
|
|
153
|
-
class
|
157
|
+
class InvalidArgumentError < WebDriverError; end
|
154
158
|
|
155
159
|
#
|
156
|
-
#
|
160
|
+
# No cookie matching the given path name was found amongst the associated cookies of the
|
161
|
+
# current browsing context's active document.
|
157
162
|
#
|
158
163
|
|
159
|
-
class
|
164
|
+
class NoSuchCookieError < WebDriverError; end
|
160
165
|
|
161
166
|
#
|
162
|
-
# A
|
167
|
+
# A screen capture was made impossible.
|
163
168
|
#
|
164
169
|
|
165
|
-
class
|
166
|
-
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
|
172
|
-
class
|
173
|
-
|
174
|
-
#
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
UnableToSetCookieError, # 25
|
201
|
-
UnhandledAlertError, # 26
|
202
|
-
NoAlertPresentError, # 27
|
203
|
-
ScriptTimeOutError, # 28
|
204
|
-
InvalidElementCoordinatesError, # 29
|
205
|
-
IMENotAvailableError, # 30
|
206
|
-
IMEEngineActivationFailedError, # 31
|
207
|
-
InvalidSelectorError, # 32
|
208
|
-
SessionNotCreatedError, # 33
|
209
|
-
MoveTargetOutOfBoundsError # 34
|
210
|
-
].freeze
|
211
|
-
|
212
|
-
class << self
|
213
|
-
def for_code(code)
|
214
|
-
return if [nil, 0].include? code
|
215
|
-
return ERRORS[code - 1] if code.is_a? Fixnum
|
216
|
-
|
217
|
-
klass_name = code.split(' ').map(&:capitalize).join
|
218
|
-
Error.const_get("#{klass_name.gsub('Error', '')}Error")
|
219
|
-
rescue NameError
|
220
|
-
WebDriverError
|
221
|
-
end
|
222
|
-
end
|
170
|
+
class UnableToCaptureScreenError < WebDriverError; end
|
171
|
+
|
172
|
+
#
|
173
|
+
# Occurs if the given session id is not in the list of active sessions, meaning the session
|
174
|
+
# either does not exist or that it's not active.
|
175
|
+
#
|
176
|
+
|
177
|
+
class InvalidSessionIdError < WebDriverError; end
|
178
|
+
|
179
|
+
#
|
180
|
+
# A modal dialog was open, blocking this operation.
|
181
|
+
#
|
182
|
+
|
183
|
+
class UnexpectedAlertOpenError < WebDriverError; end
|
184
|
+
|
185
|
+
#
|
186
|
+
# The requested command matched a known URL but did not match an method for that URL.
|
187
|
+
#
|
188
|
+
|
189
|
+
class UnknownMethodError < WebDriverError; end
|
190
|
+
|
191
|
+
#
|
192
|
+
# The Element Click command could not be completed because the element receiving the events
|
193
|
+
# is obscuring the element that was requested clicked.
|
194
|
+
#
|
195
|
+
|
196
|
+
class ElementClickInterceptedError < WebDriverError; end
|
197
|
+
|
198
|
+
#
|
199
|
+
# Indicates that a command that should have executed properly cannot be supported for some
|
200
|
+
# reason.
|
201
|
+
#
|
202
|
+
|
203
|
+
class UnsupportedOperationError < WebDriverError; end
|
204
|
+
|
223
205
|
end # Error
|
224
206
|
end # WebDriver
|
225
207
|
end # Selenium
|