selenium-webdriver 3.142.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +406 -4
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/NOTICE +2 -0
- data/README.md +4 -5
- data/lib/selenium/server.rb +69 -63
- 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/chrome/driver.rb +26 -70
- data/lib/selenium/webdriver/chrome/features.rb +106 -0
- data/lib/selenium/webdriver/chrome/options.rb +128 -53
- data/lib/selenium/webdriver/chrome/profile.rb +8 -5
- data/lib/selenium/webdriver/chrome/service.rb +8 -15
- data/lib/selenium/webdriver/chrome.rb +10 -9
- data/lib/selenium/webdriver/common/action_builder.rb +97 -249
- data/lib/selenium/webdriver/common/driver.rb +112 -23
- data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +43 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +51 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +77 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_cdp.rb} +10 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +45 -0
- data/lib/selenium/webdriver/{firefox/util.rb → common/driver_extensions/has_devtools.rb} +16 -19
- data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +38 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +144 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +30 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +136 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +11 -11
- data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +77 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +1 -0
- data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
- data/lib/selenium/webdriver/common/element.rb +82 -22
- data/lib/selenium/webdriver/common/error.rb +32 -196
- data/lib/selenium/webdriver/common/interactions/interaction.rb +4 -1
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +5 -5
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +13 -13
- data/lib/selenium/webdriver/common/log_entry.rb +2 -2
- data/lib/selenium/webdriver/common/logger.rb +50 -15
- data/lib/selenium/webdriver/common/manager.rb +15 -15
- data/lib/selenium/webdriver/common/options.rb +184 -0
- data/lib/selenium/webdriver/common/platform.rb +6 -1
- 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 +6 -3
- data/lib/selenium/webdriver/common/search_context.rb +7 -3
- data/lib/selenium/webdriver/common/service.rb +27 -122
- data/lib/selenium/webdriver/common/service_manager.rb +151 -0
- data/lib/selenium/webdriver/common/shadow_root.rb +87 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
- data/lib/selenium/webdriver/common/socket_poller.rb +2 -2
- data/lib/selenium/webdriver/common/takes_screenshot.rb +66 -0
- data/lib/selenium/webdriver/common/target_locator.rb +32 -4
- data/lib/selenium/webdriver/common/timeouts.rb +31 -4
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/common/window.rb +0 -4
- data/lib/selenium/webdriver/common/zipper.rb +3 -9
- data/lib/selenium/webdriver/common.rb +24 -17
- data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
- data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
- data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
- data/lib/selenium/webdriver/devtools/pinned_script.rb +59 -0
- data/lib/selenium/webdriver/devtools/request.rb +67 -0
- data/lib/selenium/webdriver/devtools/response.rb +66 -0
- data/lib/selenium/webdriver/devtools.rb +193 -0
- data/lib/selenium/webdriver/edge/driver.rb +7 -29
- data/lib/selenium/webdriver/{chrome/bridge.rb → edge/features.rb} +16 -22
- data/lib/selenium/webdriver/edge/options.rb +11 -48
- data/lib/selenium/webdriver/{common/w3c_manager.rb → edge/profile.rb} +7 -19
- data/lib/selenium/webdriver/edge/service.rb +10 -26
- data/lib/selenium/webdriver/edge.rb +11 -14
- data/lib/selenium/webdriver/firefox/driver.rb +31 -19
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/{bridge.rb → features.rb} +23 -4
- data/lib/selenium/webdriver/firefox/options.rb +71 -50
- data/lib/selenium/webdriver/firefox/profile.rb +21 -71
- data/lib/selenium/webdriver/firefox/service.rb +5 -9
- data/lib/selenium/webdriver/firefox.rb +22 -20
- data/lib/selenium/webdriver/ie/driver.rb +1 -47
- data/lib/selenium/webdriver/ie/options.rb +15 -46
- data/lib/selenium/webdriver/ie/service.rb +13 -15
- data/lib/selenium/webdriver/ie.rb +8 -7
- data/lib/selenium/webdriver/remote/bridge.rb +561 -86
- data/lib/selenium/webdriver/remote/capabilities.rb +159 -123
- data/lib/selenium/webdriver/remote/commands.rb +7 -0
- data/lib/selenium/webdriver/remote/driver.rb +22 -12
- data/lib/selenium/webdriver/remote/http/common.rb +0 -5
- data/lib/selenium/webdriver/remote/http/default.rb +17 -20
- data/lib/selenium/webdriver/remote/http/persistent.rb +11 -6
- data/lib/selenium/webdriver/remote/response.rb +16 -47
- data/lib/selenium/webdriver/remote.rb +15 -12
- data/lib/selenium/webdriver/safari/driver.rb +3 -31
- data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +6 -6
- data/lib/selenium/webdriver/safari/options.rb +10 -29
- data/lib/selenium/webdriver/safari/service.rb +4 -8
- data/lib/selenium/webdriver/safari.rb +17 -9
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
- data/lib/selenium/webdriver/support/cdp/domain.rb.erb +63 -0
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +108 -0
- data/lib/selenium/webdriver/support/color.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
- data/lib/selenium/webdriver/support/guards/guard.rb +89 -0
- data/lib/selenium/webdriver/{firefox/marionette/bridge.rb → support/guards/guard_condition.rb} +22 -19
- data/lib/selenium/webdriver/support/guards.rb +95 -0
- data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
- data/lib/selenium/webdriver/support/select.rb +3 -3
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +13 -13
- data/selenium-webdriver.gemspec +29 -13
- metadata +125 -73
- 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/keyboard.rb +0 -70
- 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/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,7 +20,7 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module IE
|
23
|
-
class Options
|
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,31 +20,29 @@
|
|
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
|
-
|
24
|
+
DEFAULT_PORT = 5555
|
25
|
+
EXECUTABLE = 'IEDriverServer'
|
26
|
+
MISSING_TEXT = <<~ERROR
|
31
27
|
Unable to find IEDriverServer. Please download the server from
|
32
|
-
|
28
|
+
https://www.selenium.dev/downloads/ and place it somewhere on your PATH.
|
33
29
|
More info at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver.
|
34
30
|
ERROR
|
35
|
-
|
31
|
+
SHUTDOWN_SUPPORTED = true
|
36
32
|
|
37
33
|
private
|
38
34
|
|
39
|
-
#
|
35
|
+
# NOTE: This processing is deprecated
|
40
36
|
def extract_service_args(driver_opts)
|
41
37
|
driver_args = super
|
42
38
|
driver_opts = driver_opts.dup
|
43
|
-
driver_args << "--log-level=#{driver_opts
|
44
|
-
driver_args << "--log-file=#{driver_opts
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
driver_args << "--log-level=#{driver_opts[:log_level].to_s.upcase}" if driver_opts.key?(:log_level)
|
40
|
+
driver_args << "--log-file=#{driver_opts[:log_file]}" if driver_opts.key?(:log_file)
|
41
|
+
if driver_opts.key?(:implementation)
|
42
|
+
driver_args << "--implementation=#{driver_opts[:implementation].to_s.upcase}"
|
43
|
+
end
|
44
|
+
driver_args << "--host=#{driver_opts[:host]}" if driver_opts.key?(:host)
|
45
|
+
driver_args << "--extract_path=#{driver_opts[:extract_path]}" if driver_opts.key?(:extract_path)
|
48
46
|
driver_args << "--silent" if driver_opts[:silent] == true
|
49
47
|
driver_args
|
50
48
|
end
|
@@ -17,25 +17,26 @@
|
|
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
|
23
|
+
autoload :Driver, 'selenium/webdriver/ie/driver'
|
24
|
+
autoload :Options, 'selenium/webdriver/ie/options'
|
25
|
+
autoload :Service, 'selenium/webdriver/ie/service'
|
26
|
+
|
26
27
|
def self.driver_path=(path)
|
27
28
|
WebDriver.logger.deprecate 'Selenium::WebDriver::IE#driver_path=',
|
28
|
-
'Selenium::WebDriver::IE::Service#driver_path='
|
29
|
+
'Selenium::WebDriver::IE::Service#driver_path=',
|
30
|
+
id: :driver_path
|
29
31
|
Selenium::WebDriver::IE::Service.driver_path = path
|
30
32
|
end
|
31
33
|
|
32
34
|
def self.driver_path
|
33
35
|
WebDriver.logger.deprecate 'Selenium::WebDriver::IE#driver_path',
|
34
|
-
'Selenium::WebDriver::IE::Service#driver_path'
|
36
|
+
'Selenium::WebDriver::IE::Service#driver_path',
|
37
|
+
id: :driver_path
|
35
38
|
Selenium::WebDriver::IE::Service.driver_path
|
36
39
|
end
|
37
40
|
end # IE
|
38
41
|
end # WebDriver
|
39
42
|
end # Selenium
|
40
|
-
|
41
|
-
require 'selenium/webdriver/ie/service'
|