selenium-webdriver 3.142.2 → 3.142.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59326754a9ae3f92a632b93b2c55a85567a5e1c6
4
- data.tar.gz: 544ab60eef8205b5db5d35d89aa5a44c430d908e
3
+ metadata.gz: c9f40e154da198fff9e277f0613042c22fff6c98
4
+ data.tar.gz: 33cc734e78b08e66c00a4c73f51c635d97c86fe6
5
5
  SHA512:
6
- metadata.gz: 80dc6e2ad10a7f5c38cd77c1097b63ea82a66e003acc535f751f3dc542231f4eee0a144ce08fc33b487639fc05fc7cf5ec9edfbfe45e62ab588bc0e7684a188d
7
- data.tar.gz: 3528f7acab90183f9651d18a99fba645a23f3cca3d32627f322d24ea5d9959d047cf6bab8094a5da076eec1f3b2052f653a1f7950c679dedca0270669e40fc54
6
+ metadata.gz: b40eb2e74a284b21ee31924f7cf20b878c7ab6ebcfe7848b21ad163165c80467c9d3a6fa6252ca74680b82db7186e8c1b73a2ac5f4d37501b0dfa16763ec19b9
7
+ data.tar.gz: bc9e9e0128888f3efe33f59160b677cc88655bf986877c534053adf915f3b39a78ff1d88e9b2d80753c1aba49af92f1796bb4f774ca68114027594813cc26ad3
data/CHANGES CHANGED
@@ -1,3 +1,36 @@
1
+ 3.142.7 (2019-12-27)
2
+ ====================
3
+
4
+ Ruby:
5
+ * Fix keyword argument deprecations in Ruby 2.7 (thanks @connorshea)
6
+
7
+ 3.142.6 (2019-10-04)
8
+ ====================
9
+
10
+ Ruby:
11
+ * Loosen ChildProcess dependency so that 3.0+ can be used (thanks @jaredbeck)
12
+
13
+ 3.142.5 (2019-10-01)
14
+ ====================
15
+
16
+ Ruby:
17
+ * Loosen RubyZip dependency so that 1.3+ can be used (thanks @vtamara)
18
+
19
+ 3.142.4 (2019-09-02)
20
+ ====================
21
+
22
+ Chrome:
23
+ * Added support for new command for getting logs in ChromeDriver 76+
24
+ with W3C mode on
25
+
26
+ 3.142.3 (2019-05-21)
27
+ ====================
28
+
29
+ Firefox:
30
+ * Fixed a regression when Firefox binary path was not sent to GeckoDriver
31
+ by default and browser could not be located (issue #7219)
32
+
33
+
1
34
  3.142.2 (2019-05-11)
2
35
  ====================
3
36
 
@@ -25,7 +25,9 @@ module Selenium
25
25
  COMMANDS = {
26
26
  get_network_conditions: [:get, 'session/:session_id/chromium/network_conditions'],
27
27
  set_network_conditions: [:post, 'session/:session_id/chromium/network_conditions'],
28
- send_command: [:post, 'session/:session_id/goog/cdp/execute']
28
+ send_command: [:post, 'session/:session_id/goog/cdp/execute'],
29
+ get_available_log_types: [:get, 'session/:session_id/se/log/types'],
30
+ get_log: [:post, 'session/:session_id/se/log']
29
31
  }.freeze
30
32
 
31
33
  def commands(command)
@@ -44,6 +46,22 @@ module Selenium
44
46
  execute :set_network_conditions, {}, {network_conditions: conditions}
45
47
  end
46
48
 
49
+ def available_log_types
50
+ types = execute :get_available_log_types
51
+ Array(types).map(&:to_sym)
52
+ end
53
+
54
+ def log(type)
55
+ data = execute :get_log, {}, {type: type.to_s}
56
+
57
+ Array(data).map do |l|
58
+ begin
59
+ LogEntry.new l.fetch('level', 'UNKNOWN'), l.fetch('timestamp'), l.fetch('message')
60
+ rescue KeyError
61
+ next
62
+ end
63
+ end
64
+ end
47
65
  end # Bridge
48
66
  end # Chrome
49
67
  end # WebDriver
@@ -40,7 +40,7 @@ module Selenium
40
40
  opts[:url] ||= service_url(opts)
41
41
 
42
42
  listener = opts.delete(:listener)
43
- @bridge = Remote::Bridge.handshake(opts)
43
+ @bridge = Remote::Bridge.handshake(**opts)
44
44
  @bridge.extend Bridge
45
45
 
46
46
  super(@bridge, listener: listener)
@@ -76,21 +76,29 @@ module Selenium
76
76
 
77
77
  profile = opts.delete(:profile)
78
78
  if profile
79
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Chrome::Driver#new with `:profile` parameter',
80
+ 'Selenium::WebDriver::Chrome::Options#profile or Options#add_option'
81
+
79
82
  profile = profile.as_json
80
83
 
81
- options.add_argument("--user-data-dir=#{profile[:directory]}") if options.args.none? { |arg| arg =~ /user-data-dir/ }
84
+ if options.args.none?(&/user-data-dir/.method(:match?))
85
+ options.add_argument("--user-data-dir=#{profile['directory']}")
86
+ end
82
87
 
83
- if profile[:extensions]
84
- WebDriver.logger.deprecate 'Using Selenium::WebDriver::Chrome::Profile#extensions',
88
+ if profile['extensions']
89
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Chrome::Profile#extensions',
85
90
  'Selenium::WebDriver::Chrome::Options#add_extension'
86
- profile[:extensions].each do |extension|
91
+ profile['extensions'].each do |extension|
87
92
  options.add_encoded_extension(extension)
88
93
  end
89
94
  end
90
95
  end
91
96
 
92
- detach = opts.delete(:detach)
93
- options.add_option(:detach, true) if detach
97
+ if opts.key?(:detach)
98
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Chrome::Driver#new with `:detach` parameter',
99
+ 'Selenium::WebDriver::Chrome::Options#new or Options#add_option'
100
+ options.add_option(:detach, opts.delete(:detach))
101
+ end
94
102
 
95
103
  prefs = opts.delete(:prefs)
96
104
  if prefs
@@ -103,8 +111,13 @@ module Selenium
103
111
  options = options.as_json
104
112
  caps.merge!(options) unless options[Options::KEY].empty?
105
113
 
106
- caps[:proxy] = opts.delete(:proxy) if opts.key?(:proxy)
107
- caps[:proxy] ||= opts.delete('proxy') if opts.key?('proxy')
114
+ if opts.key?(:proxy) || opts.key?('proxy')
115
+ WebDriver.logger.deprecate 'Selenium::WebDriver::Chrome::Driver#new with `:proxy` parameter',
116
+ 'Selenium::WebDriver::Chrome::Capabilities#proxy='
117
+
118
+ caps[:proxy] = opts.delete(:proxy) if opts.key?(:proxy)
119
+ caps[:proxy] ||= opts.delete('proxy') if opts.key?('proxy')
120
+ end
108
121
 
109
122
  caps
110
123
  end
@@ -20,9 +20,9 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  module Chrome
23
- class Options
23
+ class Options < WebDriver::Common::Options
24
24
  attr_reader :args, :prefs, :options, :emulation, :extensions, :encoded_extensions
25
- attr_accessor :binary
25
+ attr_accessor :binary, :profile, :detach
26
26
 
27
27
  KEY = 'goog:chromeOptions'
28
28
 
@@ -49,6 +49,8 @@ module Selenium
49
49
  @extensions = opts.delete(:extensions) || []
50
50
  @options = opts.delete(:options) || {}
51
51
  @emulation = opts.delete(:emulation) || {}
52
+ @detach = opts.delete(:detach)
53
+ @profile = opts.delete(:profile)
52
54
  @encoded_extensions = []
53
55
  end
54
56
 
@@ -170,6 +172,7 @@ module Selenium
170
172
  File.open(crx_path, 'rb') { |crx_file| Base64.strict_encode64 crx_file.read }
171
173
  end
172
174
  extensions.concat(@encoded_extensions)
175
+ add_argument("--user-data-dir=#{@profile[:directory]}") if @profile
173
176
 
174
177
  opts = @options
175
178
  opts[:binary] = @binary if @binary
@@ -177,8 +180,9 @@ module Selenium
177
180
  opts[:extensions] = extensions if extensions.any?
178
181
  opts[:mobileEmulation] = @emulation unless @emulation.empty?
179
182
  opts[:prefs] = @prefs unless @prefs.empty?
183
+ opts[:detach] = @detach if !@detach.nil? && @detach != false
180
184
 
181
- {KEY => opts}
185
+ {KEY => generate_as_json(opts)}
182
186
  end
183
187
  end # Options
184
188
  end # Chrome
@@ -77,8 +77,8 @@ module Selenium
77
77
 
78
78
  extensions.concat(@encoded_extensions)
79
79
 
80
- opts = {directory: directory || layout_on_disk}
81
- opts[:extensions] = extensions if extensions.any?
80
+ opts = {'directory' => directory || layout_on_disk}
81
+ opts['extensions'] = extensions if extensions.any?
82
82
  opts
83
83
  end
84
84
 
@@ -72,5 +72,6 @@ require 'selenium/webdriver/common/interactions/pointer_input'
72
72
  require 'selenium/webdriver/common/keys'
73
73
  require 'selenium/webdriver/common/bridge_helper'
74
74
  require 'selenium/webdriver/common/profile_helper'
75
+ require 'selenium/webdriver/common/options'
75
76
  require 'selenium/webdriver/common/driver'
76
77
  require 'selenium/webdriver/common/element'
@@ -19,29 +19,35 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- module Firefox
23
- module Bridge
22
+ module Common
23
+ class Options
24
+ private
24
25
 
25
- COMMANDS = {
26
- install_addon: [:post, 'session/:session_id/moz/addon/install'],
27
- uninstall_addon: [:post, 'session/:session_id/moz/addon/uninstall']
28
- }.freeze
29
-
30
- def commands(command)
31
- COMMANDS[command] || super
26
+ def generate_as_json(value)
27
+ if value.respond_to?(:as_json)
28
+ value.as_json
29
+ elsif value.is_a?(Hash)
30
+ value.each_with_object({}) { |(key, val), hash| hash[convert_json_key(key)] = generate_as_json(val) }
31
+ elsif value.is_a?(Array)
32
+ value.map(&method(:generate_as_json))
33
+ elsif value.is_a?(Symbol)
34
+ value.to_s
35
+ else
36
+ value
37
+ end
32
38
  end
33
39
 
34
- def install_addon(path, temporary)
35
- payload = {path: path}
36
- payload[:temporary] = temporary unless temporary.nil?
37
- execute :install_addon, {}, payload
38
- end
40
+ def convert_json_key(key)
41
+ key = camel_case(key) if key.is_a?(Symbol)
42
+ return key if key.is_a?(String)
39
43
 
40
- def uninstall_addon(id)
41
- execute :uninstall_addon, {}, {id: id}
44
+ raise TypeError, "expected String or Symbol, got #{key.inspect}:#{key.class}"
42
45
  end
43
46
 
44
- end # Bridge
45
- end # Firefox
47
+ def camel_case(str)
48
+ str.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
49
+ end
50
+ end # Options
51
+ end # Common
46
52
  end # WebDriver
47
53
  end # Selenium
@@ -37,25 +37,38 @@ module Selenium
37
37
  class << self
38
38
  attr_reader :default_port, :driver_path, :executable, :missing_text, :shutdown_supported
39
39
 
40
- def chrome(*args)
41
- Chrome::Service.new(*args)
40
+ def chrome(**opts)
41
+ Chrome::Service.new(**opts)
42
42
  end
43
43
 
44
- def firefox(*args)
45
- Firefox::Service.new(*args)
44
+ def firefox(**opts)
45
+ binary_path = Firefox::Binary.path
46
+ args = opts.delete(:args)
47
+ case args
48
+ when Hash
49
+ args[:binary] ||= binary_path
50
+ opts[:args] = args
51
+ when Array
52
+ opts[:args] = ["--binary=#{binary_path}"]
53
+ opts[:args] += args
54
+ else
55
+ opts[:args] = ["--binary=#{binary_path}"]
56
+ end
57
+
58
+ Firefox::Service.new(**opts)
46
59
  end
47
60
 
48
- def ie(*args)
49
- IE::Service.new(*args)
61
+ def ie(**opts)
62
+ IE::Service.new(**opts)
50
63
  end
51
64
  alias_method :internet_explorer, :ie
52
65
 
53
- def edge(*args)
54
- Edge::Service.new(*args)
66
+ def edge(**opts)
67
+ Edge::Service.new(**opts)
55
68
  end
56
69
 
57
- def safari(*args)
58
- Safari::Service.new(*args)
70
+ def safari(**opts)
71
+ Safari::Service.new(**opts)
59
72
  end
60
73
 
61
74
  def driver_path=(path)
@@ -44,7 +44,7 @@ module Selenium
44
44
  capabilities = bridge.create_session(desired_capabilities)
45
45
 
46
46
  WebDriver.logger.info 'Forcing W3C dialect.'
47
- @bridge = Remote::W3C::Bridge.new(capabilities, bridge.session_id, opts)
47
+ @bridge = Remote::W3C::Bridge.new(capabilities, bridge.session_id, **opts)
48
48
  @bridge.extend Edge::Bridge
49
49
 
50
50
  super(@bridge, listener: listener)
@@ -130,8 +130,8 @@ module Selenium
130
130
  @path = Platform.cygwin_path(@path, windows: true) if Platform.cygwin?
131
131
 
132
132
  unless File.file?(@path.to_s)
133
- error = "Could not find Firefox binary (os=#{Platform.os}). "
134
- error << "Make sure Firefox is installed or set the path manually with #{self}.path="
133
+ error = "Could not find Firefox binary (os=#{Platform.os}). " \
134
+ "Make sure Firefox is installed or set the path manually with #{self}.path="
135
135
  raise Error::WebDriverError, error
136
136
  end
137
137
 
@@ -42,7 +42,7 @@ module Selenium
42
42
  desired_capabilities = opts.delete(:desired_capabilities)
43
43
  bridge = Remote::Bridge.new(opts)
44
44
  capabilities = bridge.create_session(desired_capabilities)
45
- @bridge = Remote::W3C::Bridge.new(capabilities, bridge.session_id, opts)
45
+ @bridge = Remote::W3C::Bridge.new(capabilities, bridge.session_id, **opts)
46
46
  @bridge.extend Marionette::Bridge
47
47
 
48
48
  super(@bridge, listener: listener)
@@ -20,7 +20,7 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  module Firefox
23
- class Options
23
+ class Options < WebDriver::Common::Options
24
24
  attr_reader :args, :prefs, :options, :profile
25
25
  attr_accessor :binary, :log_level
26
26
 
@@ -139,7 +139,7 @@ module Selenium
139
139
  opts[:prefs] = @prefs unless @prefs.empty?
140
140
  opts[:log] = {level: @log_level} if @log_level
141
141
 
142
- {KEY => opts}
142
+ {KEY => generate_as_json(opts)}
143
143
  end
144
144
 
145
145
  private
@@ -37,7 +37,7 @@ module Selenium
37
37
  opts[:url] ||= service_url(opts)
38
38
 
39
39
  listener = opts.delete(:listener)
40
- @bridge = Remote::Bridge.handshake(opts)
40
+ @bridge = Remote::Bridge.handshake(**opts)
41
41
  super(@bridge, listener: listener)
42
42
  end
43
43
 
@@ -20,7 +20,7 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  module IE
23
- class Options
23
+ class Options < WebDriver::Common::Options
24
24
  KEY = 'se:ieOptions'
25
25
  SCROLL_TOP = 0
26
26
  SCROLL_BOTTOM = 1
@@ -130,7 +130,7 @@ module Selenium
130
130
  opts['ie.browserCommandLineSwitches'] = @args.to_a.join(' ') if @args.any?
131
131
  opts.merge!(@options)
132
132
 
133
- {KEY => opts}
133
+ {KEY => generate_as_json(opts)}
134
134
  end
135
135
  end # Options
136
136
  end # IE
@@ -57,9 +57,9 @@ module Selenium
57
57
 
58
58
  case bridge.dialect
59
59
  when :oss
60
- Remote::OSS::Bridge.new(capabilities, bridge.session_id, opts)
60
+ Remote::OSS::Bridge.new(capabilities, bridge.session_id, **opts)
61
61
  when :w3c
62
- Remote::W3C::Bridge.new(capabilities, bridge.session_id, opts)
62
+ Remote::W3C::Bridge.new(capabilities, bridge.session_id, **opts)
63
63
  else
64
64
  raise WebDriverError, 'cannot understand dialect'
65
65
  end
@@ -37,7 +37,7 @@ module Selenium
37
37
  opts[:url] ||= service_url(opts)
38
38
 
39
39
  listener = opts.delete(:listener)
40
- @bridge = Remote::Bridge.handshake(opts)
40
+ @bridge = Remote::Bridge.handshake(**opts)
41
41
  @bridge.extend Bridge
42
42
 
43
43
  super(@bridge, listener: listener)
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '3.142.2'
22
+ VERSION = '3.142.7'
23
23
  end # WebDriver
24
24
  end # Selenium
@@ -31,8 +31,8 @@ Gem::Specification.new do |s|
31
31
  s.files = Dir[root + '/**/*'].reject { |e| e =~ /ruby\.iml|build\.desc/ }.map { |e| e.sub(root + '/', '') }
32
32
  s.require_paths = ['lib']
33
33
 
34
- s.add_runtime_dependency 'childprocess', ['>= 0.5', '< 2.0']
35
- s.add_runtime_dependency 'rubyzip', ['~> 1.2', '>= 1.2.2']
34
+ s.add_runtime_dependency 'childprocess', ['>= 0.5', '< 4.0']
35
+ s.add_runtime_dependency 'rubyzip', ['>= 1.2.2']
36
36
 
37
37
  # childprocess requires ffi on windows but doesn't declare it in its dependencies
38
38
  s.add_development_dependency 'ffi'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.142.2
4
+ version: 3.142.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-11 00:00:00.000000000 Z
13
+ date: 2019-12-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  requirement: !ruby/object:Gem::Requirement
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '0.5'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '2.0'
23
+ version: '4.0'
24
24
  name: childprocess
25
25
  prerelease: false
26
26
  type: :runtime
@@ -31,13 +31,10 @@ dependencies:
31
31
  version: '0.5'
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.0'
34
+ version: '4.0'
35
35
  - !ruby/object:Gem::Dependency
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.2'
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
40
  version: 1.2.2
@@ -46,9 +43,6 @@ dependencies:
46
43
  type: :runtime
47
44
  version_requirements: !ruby/object:Gem::Requirement
48
45
  requirements:
49
- - - "~>"
50
- - !ruby/object:Gem::Version
51
- version: '1.2'
52
46
  - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: 1.2.2
@@ -246,6 +240,7 @@ files:
246
240
  - lib/selenium/webdriver/common/manager.rb
247
241
  - lib/selenium/webdriver/common/mouse.rb
248
242
  - lib/selenium/webdriver/common/navigation.rb
243
+ - lib/selenium/webdriver/common/options.rb
249
244
  - lib/selenium/webdriver/common/platform.rb
250
245
  - lib/selenium/webdriver/common/port_prober.rb
251
246
  - lib/selenium/webdriver/common/profile_helper.rb
@@ -270,7 +265,6 @@ files:
270
265
  - lib/selenium/webdriver/edge/service.rb
271
266
  - lib/selenium/webdriver/firefox.rb
272
267
  - lib/selenium/webdriver/firefox/binary.rb
273
- - lib/selenium/webdriver/firefox/bridge.rb
274
268
  - lib/selenium/webdriver/firefox/driver.rb
275
269
  - lib/selenium/webdriver/firefox/extension.rb
276
270
  - lib/selenium/webdriver/firefox/extension/prefs.json
@@ -293,7 +287,6 @@ files:
293
287
  - lib/selenium/webdriver/remote.rb
294
288
  - lib/selenium/webdriver/remote/bridge.rb
295
289
  - lib/selenium/webdriver/remote/capabilities.rb
296
- - lib/selenium/webdriver/remote/commands.rb
297
290
  - lib/selenium/webdriver/remote/driver.rb
298
291
  - lib/selenium/webdriver/remote/http/common.rb
299
292
  - lib/selenium/webdriver/remote/http/curb.rb
@@ -1,156 +0,0 @@
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
- #
25
- # https://w3c.github.io/webdriver/#endpoints
26
- # @api private
27
- #
28
-
29
- class Bridge
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
154
- end # Remote
155
- end # WebDriver
156
- end # Selenium