selenium-webdriver 3.142.7 → 4.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +583 -5
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/NOTICE +2 -0
- data/README.md +4 -5
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/server.rb +93 -78
- data/lib/selenium/webdriver/atoms/findElements.js +122 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +100 -7
- data/lib/selenium/webdriver/atoms/isDisplayed.js +76 -78
- data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
- data/lib/selenium/webdriver/atoms.rb +2 -3
- data/lib/selenium/webdriver/bidi/browsing_context.rb +88 -0
- data/lib/selenium/webdriver/bidi/browsing_context_info.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/filter_by.rb +40 -0
- data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +33 -0
- data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +33 -0
- data/lib/selenium/webdriver/bidi/log_inspector.rb +143 -0
- data/lib/selenium/webdriver/bidi/navigate_result.rb +33 -0
- data/lib/selenium/webdriver/bidi/session.rb +51 -0
- data/lib/selenium/webdriver/{common/keyboard.rb → bidi.rb} +21 -35
- data/lib/selenium/webdriver/chrome/driver.rb +9 -86
- data/lib/selenium/webdriver/chrome/features.rb +44 -0
- data/lib/selenium/webdriver/chrome/options.rb +9 -158
- data/lib/selenium/webdriver/chrome/profile.rb +3 -80
- data/lib/selenium/webdriver/chrome/service.rb +6 -33
- data/lib/selenium/webdriver/chrome.rb +5 -18
- data/lib/selenium/webdriver/chromium/driver.rb +61 -0
- data/lib/selenium/webdriver/{chrome/bridge.rb → chromium/features.rb} +51 -16
- data/lib/selenium/webdriver/chromium/options.rb +261 -0
- data/lib/selenium/webdriver/chromium/profile.rb +113 -0
- data/lib/selenium/webdriver/chromium/service.rb +42 -0
- data/lib/selenium/webdriver/chromium.rb +32 -0
- data/lib/selenium/webdriver/common/action_builder.rb +135 -237
- data/lib/selenium/webdriver/common/child_process.rb +124 -0
- data/lib/selenium/webdriver/common/driver.rb +94 -43
- data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +42 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +49 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +87 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_bidi.rb} +9 -9
- data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +86 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +36 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +42 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +41 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +36 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -9
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +143 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_remote_status.rb → has_logs.rb} +4 -4
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +16 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +69 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +11 -13
- data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +75 -0
- data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
- data/lib/selenium/webdriver/common/driver_finder.rb +43 -0
- data/lib/selenium/webdriver/common/element.rb +89 -29
- data/lib/selenium/webdriver/common/error.rb +32 -198
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
- data/lib/selenium/webdriver/common/interactions/input_device.rb +10 -4
- data/lib/selenium/webdriver/common/interactions/interaction.rb +12 -22
- data/lib/selenium/webdriver/common/interactions/interactions.rb +24 -4
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +10 -6
- data/lib/selenium/webdriver/common/interactions/key_input.rb +11 -27
- data/lib/selenium/webdriver/common/interactions/none_input.rb +10 -8
- data/lib/selenium/webdriver/common/interactions/pause.rb +49 -0
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +71 -82
- data/lib/selenium/webdriver/common/interactions/pointer_cancel.rb +45 -0
- data/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb +63 -0
- data/lib/selenium/webdriver/common/interactions/pointer_input.rb +15 -84
- data/lib/selenium/webdriver/common/interactions/pointer_move.rb +60 -0
- data/lib/selenium/webdriver/common/interactions/pointer_press.rb +85 -0
- data/lib/selenium/webdriver/common/interactions/scroll.rb +59 -0
- data/lib/selenium/webdriver/common/interactions/scroll_origin.rb +48 -0
- data/lib/selenium/webdriver/common/interactions/typing_interaction.rb +54 -0
- data/lib/selenium/webdriver/common/interactions/wheel_actions.rb +113 -0
- data/lib/selenium/webdriver/common/{w3c_manager.rb → interactions/wheel_input.rb} +14 -17
- data/lib/selenium/webdriver/common/keys.rb +1 -0
- data/lib/selenium/webdriver/common/local_driver.rb +55 -0
- data/lib/selenium/webdriver/common/log_entry.rb +2 -2
- data/lib/selenium/webdriver/common/logger.rb +58 -15
- data/lib/selenium/webdriver/common/manager.rb +11 -38
- data/lib/selenium/webdriver/common/options.rb +169 -23
- data/lib/selenium/webdriver/common/platform.rb +14 -6
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/profile_helper.rb +11 -9
- data/lib/selenium/webdriver/common/proxy.rb +7 -4
- data/lib/selenium/webdriver/common/search_context.rb +7 -9
- data/lib/selenium/webdriver/common/selenium_manager.rb +108 -0
- data/lib/selenium/webdriver/common/service.rb +17 -136
- data/lib/selenium/webdriver/common/service_manager.rb +142 -0
- data/lib/selenium/webdriver/common/shadow_root.rb +86 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +4 -4
- data/lib/selenium/webdriver/common/socket_poller.rb +3 -3
- data/lib/selenium/webdriver/common/takes_screenshot.rb +65 -0
- data/lib/selenium/webdriver/common/target_locator.rb +31 -4
- data/lib/selenium/webdriver/common/timeouts.rb +31 -4
- data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +85 -0
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +72 -0
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +62 -0
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/common/websocket_connection.rb +164 -0
- data/lib/selenium/webdriver/common/window.rb +6 -10
- data/lib/selenium/webdriver/common/zipper.rb +4 -10
- data/lib/selenium/webdriver/common.rb +42 -18
- data/lib/selenium/webdriver/devtools/console_event.rb +36 -0
- data/lib/selenium/webdriver/devtools/exception_event.rb +34 -0
- data/lib/selenium/webdriver/devtools/mutation_event.rb +35 -0
- data/lib/selenium/webdriver/devtools/network_interceptor.rb +173 -0
- data/lib/selenium/webdriver/devtools/pinned_script.rb +57 -0
- data/lib/selenium/webdriver/devtools/request.rb +65 -0
- data/lib/selenium/webdriver/devtools/response.rb +64 -0
- data/lib/selenium/webdriver/devtools.rb +96 -0
- data/lib/selenium/webdriver/edge/driver.rb +11 -27
- data/lib/selenium/webdriver/edge/features.rb +44 -0
- data/lib/selenium/webdriver/edge/options.rb +10 -49
- data/lib/selenium/webdriver/edge/profile.rb +33 -0
- data/lib/selenium/webdriver/edge/service.rb +7 -27
- data/lib/selenium/webdriver/edge.rb +11 -14
- data/lib/selenium/webdriver/firefox/driver.rb +38 -19
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/features.rb +66 -0
- data/lib/selenium/webdriver/firefox/options.rb +77 -50
- data/lib/selenium/webdriver/firefox/profile.rb +16 -70
- data/lib/selenium/webdriver/firefox/service.rb +3 -13
- data/lib/selenium/webdriver/firefox/util.rb +1 -1
- data/lib/selenium/webdriver/firefox.rb +17 -28
- data/lib/selenium/webdriver/ie/driver.rb +5 -45
- data/lib/selenium/webdriver/ie/options.rb +15 -46
- data/lib/selenium/webdriver/ie/service.rb +11 -19
- data/lib/selenium/webdriver/ie.rb +3 -16
- data/lib/selenium/webdriver/remote/bridge/commands.rb +170 -0
- data/lib/selenium/webdriver/remote/bridge.rb +590 -86
- data/lib/selenium/webdriver/remote/capabilities.rb +182 -124
- data/lib/selenium/webdriver/remote/driver.rb +30 -15
- data/lib/selenium/webdriver/remote/http/common.rb +0 -5
- data/lib/selenium/webdriver/remote/http/curb.rb +0 -2
- data/lib/selenium/webdriver/remote/http/default.rb +23 -31
- data/lib/selenium/webdriver/remote/response.rb +17 -49
- data/lib/selenium/webdriver/remote.rb +14 -12
- data/lib/selenium/webdriver/safari/driver.rb +7 -29
- data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +3 -5
- data/lib/selenium/webdriver/safari/options.rb +12 -27
- data/lib/selenium/webdriver/safari/service.rb +3 -11
- data/lib/selenium/webdriver/safari.rb +14 -20
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
- data/lib/selenium/webdriver/support/color.rb +22 -22
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
- data/lib/selenium/webdriver/support/guards/guard.rb +87 -0
- data/lib/selenium/webdriver/{firefox/marionette/bridge.rb → support/guards/guard_condition.rb} +21 -20
- data/lib/selenium/webdriver/support/guards.rb +95 -0
- data/lib/selenium/webdriver/support/relative_locator.rb +50 -0
- data/lib/selenium/webdriver/support/select.rb +6 -4
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +17 -17
- data/selenium-webdriver.gemspec +36 -18
- metadata +164 -94
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -64
- data/lib/selenium/webdriver/common/mouse.rb +0 -89
- data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
- data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
- data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
- data/lib/selenium/webdriver/edge/bridge.rb +0 -76
- data/lib/selenium/webdriver/firefox/binary.rb +0 -187
- 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 -111
- data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
- data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
- 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/remote/http/persistent.rb +0 -60
- data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
- data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
- data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
- data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -20,23 +20,13 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Firefox
|
23
|
-
#
|
24
|
-
# @api private
|
25
|
-
#
|
26
|
-
|
27
23
|
class Service < WebDriver::Service
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
Unable to find Mozilla geckodriver. Please download the server from
|
32
|
-
https://github.com/mozilla/geckodriver/releases and place it somewhere on your PATH.
|
33
|
-
More info at https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver.
|
34
|
-
ERROR
|
35
|
-
@shutdown_supported = false
|
24
|
+
DEFAULT_PORT = 4444
|
25
|
+
EXECUTABLE = 'geckodriver'
|
26
|
+
SHUTDOWN_SUPPORTED = false
|
36
27
|
|
37
28
|
private
|
38
29
|
|
39
|
-
# Note: This processing is deprecated
|
40
30
|
def extract_service_args(driver_opts)
|
41
31
|
driver_args = super
|
42
32
|
driver_opts = driver_opts.dup
|
@@ -21,46 +21,35 @@ require 'timeout'
|
|
21
21
|
require 'socket'
|
22
22
|
require 'rexml/document'
|
23
23
|
|
24
|
-
require 'selenium/webdriver/firefox/driver'
|
25
|
-
|
26
|
-
require 'selenium/webdriver/firefox/util'
|
27
|
-
require 'selenium/webdriver/firefox/extension'
|
28
|
-
require 'selenium/webdriver/firefox/binary'
|
29
|
-
require 'selenium/webdriver/firefox/profiles_ini'
|
30
|
-
require 'selenium/webdriver/firefox/profile'
|
31
|
-
require 'selenium/webdriver/firefox/launcher'
|
32
|
-
require 'selenium/webdriver/firefox/legacy/driver'
|
33
|
-
|
34
|
-
require 'selenium/webdriver/firefox/marionette/bridge'
|
35
|
-
require 'selenium/webdriver/firefox/marionette/driver'
|
36
|
-
require 'selenium/webdriver/firefox/options'
|
37
|
-
|
38
24
|
module Selenium
|
39
25
|
module WebDriver
|
40
26
|
module Firefox
|
27
|
+
autoload :Util, 'selenium/webdriver/firefox/util'
|
28
|
+
autoload :Extension, 'selenium/webdriver/firefox/extension'
|
29
|
+
autoload :ProfilesIni, 'selenium/webdriver/firefox/profiles_ini'
|
30
|
+
autoload :Profile, 'selenium/webdriver/firefox/profile'
|
31
|
+
autoload :Features, 'selenium/webdriver/firefox/features'
|
32
|
+
autoload :Driver, 'selenium/webdriver/firefox/driver'
|
33
|
+
autoload :Options, 'selenium/webdriver/firefox/options'
|
34
|
+
autoload :Service, 'selenium/webdriver/firefox/service'
|
35
|
+
|
41
36
|
DEFAULT_PORT = 7055
|
42
|
-
DEFAULT_ENABLE_NATIVE_EVENTS = Platform.os == :windows
|
43
37
|
DEFAULT_SECURE_SSL = false
|
44
38
|
DEFAULT_ASSUME_UNTRUSTED_ISSUER = true
|
45
39
|
DEFAULT_LOAD_NO_FOCUS_LIB = false
|
46
40
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
Selenium::WebDriver::Firefox::Service.driver_path = path
|
51
|
-
end
|
41
|
+
# Mozilla Automation Team asked to only support 85
|
42
|
+
# until WebDriver Bidi is available.
|
43
|
+
DEVTOOLS_VERSION = 85
|
52
44
|
|
53
|
-
def self.
|
54
|
-
|
55
|
-
|
56
|
-
Selenium::WebDriver::Firefox::Service.driver_path
|
45
|
+
def self.path=(path)
|
46
|
+
Platform.assert_executable path
|
47
|
+
@path = path
|
57
48
|
end
|
58
49
|
|
59
|
-
def self.path
|
60
|
-
|
50
|
+
def self.path
|
51
|
+
@path ||= nil
|
61
52
|
end
|
62
53
|
end # Firefox
|
63
54
|
end # WebDriver
|
64
55
|
end # Selenium
|
65
|
-
|
66
|
-
require 'selenium/webdriver/firefox/service'
|
@@ -20,7 +20,6 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module IE
|
23
|
-
|
24
23
|
#
|
25
24
|
# Driver implementation for Internet Explorer supporting
|
26
25
|
# both OSS and W3C dialects of JSON wire protocol.
|
@@ -28,57 +27,18 @@ module Selenium
|
|
28
27
|
#
|
29
28
|
|
30
29
|
class Driver < WebDriver::Driver
|
31
|
-
|
32
|
-
include DriverExtensions::TakesScreenshot
|
33
|
-
|
34
|
-
def initialize(opts = {})
|
35
|
-
opts[:desired_capabilities] = create_capabilities(opts)
|
30
|
+
EXTENSIONS = [DriverExtensions::HasWebStorage].freeze
|
36
31
|
|
37
|
-
|
32
|
+
include LocalDriver
|
38
33
|
|
39
|
-
|
40
|
-
|
41
|
-
super(
|
34
|
+
def initialize(capabilities: nil, options: nil, service: nil, url: nil, **opts)
|
35
|
+
caps, url = initialize_local_driver(capabilities, options, service, url)
|
36
|
+
super(caps: caps, url: url, **opts)
|
42
37
|
end
|
43
38
|
|
44
39
|
def browser
|
45
40
|
:internet_explorer
|
46
41
|
end
|
47
|
-
|
48
|
-
def quit
|
49
|
-
super
|
50
|
-
ensure
|
51
|
-
@service&.stop
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
def create_capabilities(opts)
|
57
|
-
caps = opts.delete(:desired_capabilities) { Remote::Capabilities.internet_explorer }
|
58
|
-
options = opts.delete(:options) { Options.new }
|
59
|
-
|
60
|
-
if opts.delete(:introduce_flakiness_by_ignoring_security_domains)
|
61
|
-
WebDriver.logger.deprecate ':introduce_flakiness_by_ignoring_security_domains',
|
62
|
-
'Selenium::WebDriver::IE::Options#ignore_protected_mode_settings='
|
63
|
-
options.ignore_protected_mode_settings = true
|
64
|
-
end
|
65
|
-
|
66
|
-
native_events = opts.delete(:native_events)
|
67
|
-
unless native_events.nil?
|
68
|
-
WebDriver.logger.deprecate ':native_events', 'Selenium::WebDriver::IE::Options#native_events='
|
69
|
-
options.native_events = native_events
|
70
|
-
end
|
71
|
-
|
72
|
-
# Backward compatibility with older IEDriverServer versions
|
73
|
-
caps[:ignore_protected_mode_settings] = options.ignore_protected_mode_settings
|
74
|
-
caps[:native_events] = options.native_events
|
75
|
-
|
76
|
-
options = options.as_json
|
77
|
-
caps.merge!(options) unless options.empty?
|
78
|
-
|
79
|
-
caps
|
80
|
-
end
|
81
|
-
|
82
42
|
end # Driver
|
83
43
|
end # IE
|
84
44
|
end # WebDriver
|
@@ -20,7 +20,7 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module IE
|
23
|
-
class Options < WebDriver::
|
23
|
+
class Options < WebDriver::Options
|
24
24
|
KEY = 'se:ieOptions'
|
25
25
|
SCROLL_TOP = 0
|
26
26
|
SCROLL_BOTTOM = 1
|
@@ -39,32 +39,25 @@ module Selenium
|
|
39
39
|
persistent_hover: 'enablePersistentHover',
|
40
40
|
require_window_focus: 'requireWindowFocus',
|
41
41
|
use_per_process_proxy: 'ie.usePerProcessProxy',
|
42
|
-
|
42
|
+
use_legacy_file_upload_dialog_handling: 'ie.useLegacyFileUploadDialogHandling',
|
43
|
+
attach_to_edge_chrome: 'ie.edgechromium',
|
44
|
+
edge_executable_path: 'ie.edgepath'
|
43
45
|
}.freeze
|
46
|
+
BROWSER = 'internet explorer'
|
44
47
|
|
45
|
-
|
46
|
-
define_method key do
|
47
|
-
@options[key]
|
48
|
-
end
|
49
|
-
|
50
|
-
define_method "#{key}=" do |value|
|
51
|
-
@options[key] = value
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
attr_reader :args, :options
|
48
|
+
attr_reader :args
|
56
49
|
|
57
50
|
#
|
58
51
|
# Create a new Options instance
|
59
52
|
#
|
60
53
|
# @example
|
61
54
|
# options = Selenium::WebDriver::IE::Options.new(args: ['--host=127.0.0.1'])
|
62
|
-
# driver = Selenium::WebDriver.for(:ie,
|
55
|
+
# driver = Selenium::WebDriver.for(:ie, capabilities: options)
|
63
56
|
#
|
64
57
|
# @example
|
65
58
|
# options = Selenium::WebDriver::IE::Options.new
|
66
59
|
# options.element_scroll_behavior = Selenium::WebDriver::IE::Options::SCROLL_BOTTOM
|
67
|
-
# driver = Selenium::WebDriver.for(:ie,
|
60
|
+
# driver = Selenium::WebDriver.for(:ie, capabilities: options)
|
68
61
|
#
|
69
62
|
# @param [Hash] opts the pre-defined options
|
70
63
|
# @option opts [Array<String>] args
|
@@ -86,8 +79,9 @@ module Selenium
|
|
86
79
|
#
|
87
80
|
|
88
81
|
def initialize(**opts)
|
89
|
-
@args =
|
90
|
-
|
82
|
+
@args = (opts.delete(:args) || []).to_set
|
83
|
+
super(**opts)
|
84
|
+
|
91
85
|
@options[:native_events] = true if @options[:native_events].nil?
|
92
86
|
end
|
93
87
|
|
@@ -101,36 +95,11 @@ module Selenium
|
|
101
95
|
@args << arg
|
102
96
|
end
|
103
97
|
|
104
|
-
|
105
|
-
# Add a new option not yet handled by these bindings.
|
106
|
-
#
|
107
|
-
# @example
|
108
|
-
# options = Selenium::WebDriver::IE::Options.new
|
109
|
-
# options.add_option(:foo, 'bar')
|
110
|
-
#
|
111
|
-
# @param [String, Symbol] name Name of the option
|
112
|
-
# @param [Boolean, String, Integer] value Value of the option
|
113
|
-
#
|
114
|
-
|
115
|
-
def add_option(name, value)
|
116
|
-
@options[name] = value
|
117
|
-
end
|
118
|
-
|
119
|
-
#
|
120
|
-
# @api private
|
121
|
-
#
|
122
|
-
|
123
|
-
def as_json(*)
|
124
|
-
opts = {}
|
125
|
-
|
126
|
-
CAPABILITIES.each do |capability_alias, capability_name|
|
127
|
-
capability_value = @options.delete(capability_alias)
|
128
|
-
opts[capability_name] = capability_value unless capability_value.nil?
|
129
|
-
end
|
130
|
-
opts['ie.browserCommandLineSwitches'] = @args.to_a.join(' ') if @args.any?
|
131
|
-
opts.merge!(@options)
|
98
|
+
private
|
132
99
|
|
133
|
-
|
100
|
+
def process_browser_options(browser_options)
|
101
|
+
options = browser_options[KEY]
|
102
|
+
options['ie.browserCommandLineSwitches'] = @args.to_a.join(' ') if @args.any?
|
134
103
|
end
|
135
104
|
end # Options
|
136
105
|
end # IE
|
@@ -20,32 +20,24 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module IE
|
23
|
-
#
|
24
|
-
# @api private
|
25
|
-
#
|
26
|
-
|
27
23
|
class Service < WebDriver::Service
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
Unable to find IEDriverServer. Please download the server from
|
32
|
-
http://selenium-release.storage.googleapis.com/index.html and place it somewhere on your PATH.
|
33
|
-
More info at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver.
|
34
|
-
ERROR
|
35
|
-
@shutdown_supported = true
|
24
|
+
DEFAULT_PORT = 5555
|
25
|
+
EXECUTABLE = 'IEDriverServer'
|
26
|
+
SHUTDOWN_SUPPORTED = true
|
36
27
|
|
37
28
|
private
|
38
29
|
|
39
|
-
# Note: This processing is deprecated
|
40
30
|
def extract_service_args(driver_opts)
|
41
31
|
driver_args = super
|
42
32
|
driver_opts = driver_opts.dup
|
43
|
-
driver_args << "--log-level=#{driver_opts
|
44
|
-
driver_args << "--log-file=#{driver_opts
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
driver_args << "--
|
33
|
+
driver_args << "--log-level=#{driver_opts[:log_level].to_s.upcase}" if driver_opts.key?(:log_level)
|
34
|
+
driver_args << "--log-file=#{driver_opts[:log_file]}" if driver_opts.key?(:log_file)
|
35
|
+
if driver_opts.key?(:implementation)
|
36
|
+
driver_args << "--implementation=#{driver_opts[:implementation].to_s.upcase}"
|
37
|
+
end
|
38
|
+
driver_args << "--host=#{driver_opts[:host]}" if driver_opts.key?(:host)
|
39
|
+
driver_args << "--extract_path=#{driver_opts[:extract_path]}" if driver_opts.key?(:extract_path)
|
40
|
+
driver_args << '--silent' if driver_opts[:silent] == true
|
49
41
|
driver_args
|
50
42
|
end
|
51
43
|
end # Server
|
@@ -17,25 +17,12 @@
|
|
17
17
|
# specific language governing permissions and limitations
|
18
18
|
# under the License.
|
19
19
|
|
20
|
-
require 'selenium/webdriver/ie/driver'
|
21
|
-
require 'selenium/webdriver/ie/options'
|
22
|
-
|
23
20
|
module Selenium
|
24
21
|
module WebDriver
|
25
22
|
module IE
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
Selenium::WebDriver::IE::Service.driver_path = path
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.driver_path
|
33
|
-
WebDriver.logger.deprecate 'Selenium::WebDriver::IE#driver_path',
|
34
|
-
'Selenium::WebDriver::IE::Service#driver_path'
|
35
|
-
Selenium::WebDriver::IE::Service.driver_path
|
36
|
-
end
|
23
|
+
autoload :Driver, 'selenium/webdriver/ie/driver'
|
24
|
+
autoload :Options, 'selenium/webdriver/ie/options'
|
25
|
+
autoload :Service, 'selenium/webdriver/ie/service'
|
37
26
|
end # IE
|
38
27
|
end # WebDriver
|
39
28
|
end # Selenium
|
40
|
-
|
41
|
-
require 'selenium/webdriver/ie/service'
|
@@ -0,0 +1,170 @@
|
|
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 Remote
|
23
|
+
#
|
24
|
+
# https://w3c.github.io/webdriver/#endpoints
|
25
|
+
# @api private
|
26
|
+
#
|
27
|
+
|
28
|
+
class Bridge
|
29
|
+
COMMANDS = {
|
30
|
+
status: [:get, 'status'],
|
31
|
+
|
32
|
+
#
|
33
|
+
# session handling
|
34
|
+
#
|
35
|
+
|
36
|
+
new_session: [:post, 'session'],
|
37
|
+
delete_session: [:delete, 'session/:session_id'],
|
38
|
+
|
39
|
+
#
|
40
|
+
# basic driver
|
41
|
+
#
|
42
|
+
|
43
|
+
get: [:post, 'session/:session_id/url'],
|
44
|
+
get_current_url: [:get, 'session/:session_id/url'],
|
45
|
+
back: [:post, 'session/:session_id/back'],
|
46
|
+
forward: [:post, 'session/:session_id/forward'],
|
47
|
+
refresh: [:post, 'session/:session_id/refresh'],
|
48
|
+
get_title: [:get, 'session/:session_id/title'],
|
49
|
+
|
50
|
+
#
|
51
|
+
# window and Frame handling
|
52
|
+
#
|
53
|
+
|
54
|
+
get_window_handle: [:get, 'session/:session_id/window'],
|
55
|
+
new_window: [:post, 'session/:session_id/window/new'],
|
56
|
+
close_window: [:delete, 'session/:session_id/window'],
|
57
|
+
switch_to_window: [:post, 'session/:session_id/window'],
|
58
|
+
get_window_handles: [:get, 'session/:session_id/window/handles'],
|
59
|
+
fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],
|
60
|
+
minimize_window: [:post, 'session/:session_id/window/minimize'],
|
61
|
+
maximize_window: [:post, 'session/:session_id/window/maximize'],
|
62
|
+
set_window_rect: [:post, 'session/:session_id/window/rect'],
|
63
|
+
get_window_rect: [:get, 'session/:session_id/window/rect'],
|
64
|
+
switch_to_frame: [:post, 'session/:session_id/frame'],
|
65
|
+
switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
|
66
|
+
|
67
|
+
#
|
68
|
+
# element
|
69
|
+
#
|
70
|
+
|
71
|
+
find_element: [:post, 'session/:session_id/element'],
|
72
|
+
find_elements: [:post, 'session/:session_id/elements'],
|
73
|
+
find_child_element: [:post, 'session/:session_id/element/:id/element'],
|
74
|
+
find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
|
75
|
+
find_shadow_child_element: [:post, 'session/:session_id/shadow/:id/element'],
|
76
|
+
find_shadow_child_elements: [:post, 'session/:session_id/shadow/:id/elements'],
|
77
|
+
get_active_element: [:get, 'session/:session_id/element/active'],
|
78
|
+
get_element_shadow_root: [:get, 'session/:session_id/element/:id/shadow'],
|
79
|
+
is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
|
80
|
+
get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
|
81
|
+
get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
|
82
|
+
get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
|
83
|
+
get_element_aria_role: [:get, 'session/:session_id/element/:id/computedrole'],
|
84
|
+
get_element_aria_label: [:get, 'session/:session_id/element/:id/computedlabel'],
|
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
|
+
get_timeouts: [:get, 'session/:session_id/timeouts'],
|
113
|
+
set_timeout: [:post, 'session/:session_id/timeouts'],
|
114
|
+
|
115
|
+
#
|
116
|
+
# actions
|
117
|
+
#
|
118
|
+
|
119
|
+
actions: [:post, 'session/:session_id/actions'],
|
120
|
+
release_actions: [:delete, 'session/:session_id/actions'],
|
121
|
+
print_page: [:post, 'session/:session_id/print'],
|
122
|
+
|
123
|
+
#
|
124
|
+
# Element Operations
|
125
|
+
#
|
126
|
+
|
127
|
+
element_click: [:post, 'session/:session_id/element/:id/click'],
|
128
|
+
element_clear: [:post, 'session/:session_id/element/:id/clear'],
|
129
|
+
element_send_keys: [:post, 'session/:session_id/element/:id/value'],
|
130
|
+
|
131
|
+
#
|
132
|
+
# alerts
|
133
|
+
#
|
134
|
+
|
135
|
+
dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],
|
136
|
+
accept_alert: [:post, 'session/:session_id/alert/accept'],
|
137
|
+
get_alert_text: [:get, 'session/:session_id/alert/text'],
|
138
|
+
send_alert_text: [:post, 'session/:session_id/alert/text'],
|
139
|
+
|
140
|
+
#
|
141
|
+
# screenshot
|
142
|
+
#
|
143
|
+
|
144
|
+
take_screenshot: [:get, 'session/:session_id/screenshot'],
|
145
|
+
take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],
|
146
|
+
|
147
|
+
#
|
148
|
+
# server extensions
|
149
|
+
#
|
150
|
+
|
151
|
+
upload_file: [:post, 'session/:session_id/se/file'],
|
152
|
+
|
153
|
+
#
|
154
|
+
# virtual-authenticator
|
155
|
+
#
|
156
|
+
|
157
|
+
add_virtual_authenticator: [:post, 'session/:session_id/webauthn/authenticator'],
|
158
|
+
remove_virtual_authenticator: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId'],
|
159
|
+
add_credential: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/credential'],
|
160
|
+
get_credentials: [:get, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],
|
161
|
+
remove_credential: [:delete,
|
162
|
+
'session/:session_id/webauthn/authenticator/:authenticatorId/credentials/:credentialId'],
|
163
|
+
remove_all_credentials: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],
|
164
|
+
set_user_verified: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/uv']
|
165
|
+
|
166
|
+
}.freeze
|
167
|
+
end # Bridge
|
168
|
+
end # Remote
|
169
|
+
end # WebDriver
|
170
|
+
end # Selenium
|