selenium-webdriver 4.29.1 → 4.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +18 -0
- 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 +1 -1
- data/lib/selenium/webdriver/atoms/findElements.js +1 -1
- data/lib/selenium/webdriver/atoms/getAttribute.js +1 -1
- data/lib/selenium/webdriver/atoms/isDisplayed.js +1 -1
- data/lib/selenium/webdriver/bidi/browsing_context.rb +15 -0
- data/lib/selenium/webdriver/chromium/driver.rb +0 -1
- data/lib/selenium/webdriver/common/driver.rb +1 -17
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +4 -3
- data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -0
- data/lib/selenium/webdriver/common.rb +0 -4
- data/lib/selenium/webdriver/devtools.rb +7 -5
- data/lib/selenium/webdriver/firefox/driver.rb +0 -1
- data/lib/selenium/webdriver/ie/driver.rb +1 -1
- data/lib/selenium/webdriver/remote/bridge.rb +2 -62
- data/lib/selenium/webdriver/safari/driver.rb +1 -2
- data/lib/selenium/webdriver/version.rb +1 -1
- metadata +2 -6
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +0 -38
- data/lib/selenium/webdriver/common/html5/local_storage.rb +0 -59
- data/lib/selenium/webdriver/common/html5/session_storage.rb +0 -61
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02e236d63d0f26b6316b3761e1acbbcf87ee028c46f2d02fafd79f39fd3d6976
|
4
|
+
data.tar.gz: 1678c3a0fc99ff711961082557765f5b8c60fca7136ed3a88cb5ee8ab0bec975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ced9ef725e510967f00b425d405229f9b3b3454ed26e0c4daf37886e756ac466c8dacfa53d7aa68d4ef99f6a24561b310ea3f0692f30059245d20691d9f7b814
|
7
|
+
data.tar.gz: fef323115cca668aaa59d472c5bba1a450b483f290958ed8dafee560a8d71f90eb90114b14f32b83966e4c25024e938a3d795d2d890bd491a8665ce49d4a3f8e
|
data/CHANGES
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
4.30.0 (2025-03-20)
|
2
|
+
=========================
|
3
|
+
Ruby:
|
4
|
+
* Raise error when trying to delete a cookie without a name (#15386)
|
5
|
+
* Remove deprecated html 5 web storage features
|
6
|
+
* Remove deprecated script alias for execute_script
|
7
|
+
* Add debug message for location of screenshot
|
8
|
+
|
9
|
+
BiDi:
|
10
|
+
* Add set viewport for browsing context (#15290)
|
11
|
+
* Add support for handling user prompt (#15291)
|
12
|
+
* Add Browser context activate command (#15365)
|
13
|
+
|
14
|
+
DevTools:
|
15
|
+
* Add support for 134 and remove 131
|
16
|
+
* Remove support for v85 since no longer required by Firefox
|
17
|
+
* Add support for additional target types (#15416)
|
18
|
+
|
1
19
|
4.29.1 (2025-02-22)
|
2
20
|
=========================
|
3
21
|
* [rb] Fix "no anonymous block parameter" in ruby 3.1 (#15315)
|
data/bin/linux/selenium-manager
CHANGED
Binary file
|
data/bin/macos/selenium-manager
CHANGED
Binary file
|
Binary file
|
data/lib/selenium/server.rb
CHANGED
@@ -183,7 +183,7 @@ module Selenium
|
|
183
183
|
def initialize(jar, opts = {})
|
184
184
|
raise Errno::ENOENT, jar unless File.exist?(jar)
|
185
185
|
|
186
|
-
@java = opts.fetch(:java, 'java')
|
186
|
+
@java = opts.fetch(:java, 'java') || 'java'
|
187
187
|
@jar = jar
|
188
188
|
@host = '127.0.0.1'
|
189
189
|
@role = opts.fetch(:role, 'standalone')
|
@@ -121,4 +121,4 @@ Z.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(t||Hc)&&Ac(d?d
|
|
121
121
|
null}}try{return d.evaluate(b,a,e,c,null)}catch(n){if("TypeError"===n.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):Z.I,d.evaluate(b,a,e,c,null);throw n;}}catch(n){if(!Na||"NS_ERROR_ILLEGAL_VALUE"!=n.name)throw new P(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+n);}};Z.J=function(a,b){if(!a||1!=a.nodeType)throw new P(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
|
122
122
|
Z.s=function(a,b){var c=function(){var d=Z.u(b,a,9);return d?d.singleNodeValue||null:b.selectSingleNode?(d=A(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||Z.J(c,a);return c};
|
123
123
|
Z.j=function(a,b){var c=function(){var d=Z.u(b,a,7);if(d){for(var e=d.snapshotLength,f=[],g=0;g<e;++g)f.push(d.snapshotItem(g));return f}return b.selectNodes?(d=A(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();l(c,function(d){Z.J(d,a)});return c};var td={className:Dc,"class name":Dc,css:Nc,"css selector":Nc,relative:Y,id:qd,linkText:X,"link text":X,name:{s:function(a,b){b=mb(eb(b),"*",null,b);return ua(b,function(c){return Uc(c,"name")==a})},j:function(a,b){b=mb(eb(b),"*",null,b);return pa(b,function(c){return Uc(c,"name")==a})}},partialLinkText:rd,"partial link text":rd,tagName:vd,"tag name":vd,xpath:Z};function sd(a){for(var b in a)if(a.hasOwnProperty(b))return b;return null}
|
124
|
-
function ud(a,b){var c=sd(a);if(c){var d=td[c];if(d&&ea(d.j))return d.j(a[c],b||Bc.document)}throw new P(61,"Unsupported locator strategy: "+c);};ca("
|
124
|
+
function ud(a,b){var c=sd(a);if(c){var d=td[c];if(d&&ea(d.j))return d.j(a[c],b||Bc.document)}throw new P(61,"Unsupported locator strategy: "+c);};ca("se_exportedFunctionSymbol",ud);; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
|
@@ -3,4 +3,4 @@ m[51]="invalid selector";m[52]="invalid selector";m[17]="javascript error";m[405
|
|
3
3
|
a:{var F="",G=function(){var a=p;if(B)return/rv:([^\);]+)(\)|;)/.exec(a);if(A)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(C)return/WebKit\/(\S+)/.exec(a);if(y)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(z){var H=D();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var I;I=d.document&&z?D():void 0;var J=u(),K=w()||t("iPod"),L=t("iPad"),M=t("Android")&&!(v()||u()||t("Opera")||t("Silk")),N=v(),aa=t("Safari")&&!(v()||t("Coast")||t("Opera")||t("Edge")||t("Edg/")||t("OPR")||u()||t("Silk")||t("Android"))&&!(w()||t("iPad")||t("iPod"));function O(a){return(a=a.exec(p))?a[1]:""}(function(){if(J)return O(/Firefox\/([0-9.]+)/);if(z||A||y)return E;if(N)return w()||t("iPad")||t("iPod")?O(/CriOS\/([0-9.]+)/):O(/Chrome\/([0-9.]+)/);if(aa&&!(w()||t("iPad")||t("iPod")))return O(/Version\/([0-9.]+)/);if(K||L){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(p);if(a)return a[1]+"."+a[2]}else if(M)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""})();var P=z&&!(8<=Number(I)),ba=z&&!(9<=Number(I));var ca={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Q={IMG:" ",BR:"\n"};function R(a,b,c){if(!(a.nodeName in ca))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Q)b.push(Q[a.nodeName]);else for(a=a.firstChild;a;)R(a,b,c),a=a.nextSibling};function S(a,b){b=b.toLowerCase();return"style"==b?da(a.style.cssText):P&&"value"==b&&T(a,"INPUT")?a.value:ba&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var ea=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;
|
4
4
|
function da(a){var b=[];k(a.split(ea),function(c){var e=c.indexOf(":");0<e&&(c=[c.slice(0,e),c.slice(e+1)],2==c.length&&b.push(c[0].toLowerCase(),":",c[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function U(a,b){P&&"value"==b&&T(a,"OPTION")&&null===S(a,"value")?(b=[],R(a,b,!1),a=b.join("")):a=a[b];return a}
|
5
5
|
function T(a,b){b&&"string"!==typeof b&&(b=b.toString());return a instanceof HTMLFormElement?!!a&&1==a.nodeType&&(!b||"FORM"==b):!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function V(a){return T(a,"OPTION")?!0:T(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):!1};var fa={"class":"className",readonly:"readOnly"},ha="allowfullscreen allowpaymentrequest allowusermedia async autofocus autoplay checked compact complete controls declare default defaultchecked defaultselected defer disabled ended formnovalidate hidden indeterminate iscontenteditable ismap itemscope loop multiple muted nohref nomodule noresize noshade novalidate nowrap open paused playsinline pubdate readonly required reversed scoped seamless seeking selected truespeed typemustmatch willvalidate".split(" ");function W(a,b){var c=null,e=b.toLowerCase();if("style"==e)return(c=a.style)&&"string"!=typeof c&&(c=c.cssText),c;if(("selected"==e||"checked"==e)&&V(a)){if(!V(a))throw new l(15,"Element is not selectable");b="selected";c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";return U(a,b)?"true":null}var g=T(a,"A");if(T(a,"IMG")&&"src"==e||g&&"href"==e)return(c=S(a,e))&&(c=U(a,e)),c;if("spellcheck"==e){c=S(a,e);if(null!==c){if("false"==c.toLowerCase())return"false";if("true"==c.toLowerCase())return"true"}return U(a,
|
6
|
-
e)+""}g=fa[b]||b;if(0<=h(ha,e))return(c=null!==S(a,b)||U(a,g))?"true":null;try{var x=U(a,g)}catch(ia){}(e=null==x)||(e=typeof x,e="object"==e&&null!=x||"function"==e);e?c=S(a,b):c=x;return null!=c?c.toString():null}var X=["
|
6
|
+
e)+""}g=fa[b]||b;if(0<=h(ha,e))return(c=null!==S(a,b)||U(a,g))?"true":null;try{var x=U(a,g)}catch(ia){}(e=null==x)||(e=typeof x,e="object"==e&&null!=x||"function"==e);e?c=S(a,b):c=x;return null!=c?c.toString():null}var X=["se_exportedFunctionSymbol"],Y=d;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===W?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=W;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
|
@@ -25,4 +25,4 @@ function Oa(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.pa
|
|
25
25
|
n&&1==n.nodeType?n:null)d=V(e),b||"default"==a.shape.toLowerCase()||(a=Ra(a),b=Math.min(Math.max(a.a,0),d.width),n=Math.min(Math.max(a.b,0),d.height),d=new R(b+d.a,n+d.b,Math.min(a.width,d.width-b),Math.min(a.height,d.height-n)))}return{image:e,rect:d||new R(0,0,0,0)}}
|
26
26
|
function Ra(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new R(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new R(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var e=b,d=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),e=Math.max(e,a[f]),c=Math.min(c,a[f+1]),d=Math.max(d,a[f+1]);return new R(b,c,e-b,d-c)}return new R(0,0,0,0)}function Qa(a){a=V(a);return new Q(a.b,a.a+a.width,a.b+a.height,a.a)}
|
27
27
|
function Pa(a){if(Ia){if("relative"==T(a,"position"))return 1;a=T(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sa(a)}function Sa(a){var b=1,c=T(a,"opacity");c&&(b=Number(c));(a=S(a))&&(b*=Sa(a));return b};function Ta(a,b){function c(e){if(P(e)&&"none"==T(e,"display"))return!1;var d;if((d=e.parentNode)&&d.shadowRoot&&void 0!==e.assignedSlot)d=e.assignedSlot?e.assignedSlot.parentNode:null;else if(e.getDestinationInsertionPoints){var f=e.getDestinationInsertionPoints();0<f.length&&(d=f[f.length-1])}if(La&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&P(d,"DETAILS")&&!d.open&&!P(e,"SUMMARY")?!1:!!d&&c(d):!0}return U(a,
|
28
|
-
!!b,c)}var X=["
|
28
|
+
!!b,c)}var X=["se_exportedFunctionSymbol"],Y=g;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Ta?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Ta;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
|
@@ -94,6 +94,21 @@ module Selenium
|
|
94
94
|
result = @bidi.send_cmd('browsingContext.create', type: type.to_s, referenceContext: context_id)
|
95
95
|
result['context']
|
96
96
|
end
|
97
|
+
|
98
|
+
def set_viewport(context_id: nil, width: nil, height: nil, device_pixel_ratio: nil)
|
99
|
+
context_id ||= @bridge.window_handle
|
100
|
+
params = {context: context_id, viewport: {width:, height:}, device_pixel_ratio:}
|
101
|
+
@bidi.send_cmd('browsingContext.setViewport', **params)
|
102
|
+
end
|
103
|
+
|
104
|
+
def handle_user_prompt(context_id, accept: true, text: nil)
|
105
|
+
@bidi.send_cmd('browsingContext.handleUserPrompt', context: context_id, accept: accept, text: text)
|
106
|
+
end
|
107
|
+
|
108
|
+
def activate(context_id: nil)
|
109
|
+
context_id ||= @bridge.window_handle
|
110
|
+
@bidi.send_cmd('browsingContext.activate', context: context_id)
|
111
|
+
end
|
97
112
|
end
|
98
113
|
end # BiDi
|
99
114
|
end # WebDriver
|
@@ -32,7 +32,6 @@ module Selenium
|
|
32
32
|
DriverExtensions::HasFedCmDialog,
|
33
33
|
DriverExtensions::HasNetworkConditions,
|
34
34
|
DriverExtensions::HasNetworkInterception,
|
35
|
-
DriverExtensions::HasWebStorage,
|
36
35
|
DriverExtensions::HasLaunching,
|
37
36
|
DriverExtensions::HasPermissions,
|
38
37
|
DriverExtensions::DownloadsFiles,
|
@@ -99,22 +99,6 @@ module Selenium
|
|
99
99
|
@navigate ||= WebDriver::Navigation.new(bridge)
|
100
100
|
end
|
101
101
|
|
102
|
-
#
|
103
|
-
# @return [Script]
|
104
|
-
# @see Script
|
105
|
-
#
|
106
|
-
|
107
|
-
def script(*args)
|
108
|
-
if args.any?
|
109
|
-
WebDriver.logger.deprecate('`Driver#script` as an alias for `#execute_script`',
|
110
|
-
'`Driver#execute_script`',
|
111
|
-
id: :driver_script)
|
112
|
-
execute_script(*args)
|
113
|
-
else
|
114
|
-
@script ||= WebDriver::Script.new(bridge)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
102
|
#
|
119
103
|
# @return [TargetLocator]
|
120
104
|
# @see TargetLocator
|
@@ -188,7 +172,7 @@ module Selenium
|
|
188
172
|
bridge.quit
|
189
173
|
ensure
|
190
174
|
@service_manager&.stop
|
191
|
-
@devtools&.close
|
175
|
+
@devtools&.each_value(&:close)
|
192
176
|
end
|
193
177
|
|
194
178
|
#
|
@@ -27,12 +27,13 @@ module Selenium
|
|
27
27
|
# @return [DevTools]
|
28
28
|
#
|
29
29
|
|
30
|
-
def devtools
|
31
|
-
@devtools ||=
|
30
|
+
def devtools(target_type: 'page')
|
31
|
+
@devtools ||= {}
|
32
|
+
@devtools[target_type] ||= begin
|
32
33
|
require 'selenium/devtools'
|
33
34
|
Selenium::DevTools.version ||= devtools_version
|
34
35
|
Selenium::DevTools.load_version
|
35
|
-
Selenium::WebDriver::DevTools.new(url: devtools_url)
|
36
|
+
Selenium::WebDriver::DevTools.new(url: devtools_url, target_type: target_type)
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end # HasDevTools
|
@@ -63,10 +63,6 @@ require 'selenium/webdriver/common/action_builder'
|
|
63
63
|
require 'selenium/webdriver/common/virtual_authenticator/credential'
|
64
64
|
require 'selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options'
|
65
65
|
require 'selenium/webdriver/common/virtual_authenticator/virtual_authenticator'
|
66
|
-
require 'selenium/webdriver/common/html5/shared_web_storage'
|
67
|
-
require 'selenium/webdriver/common/html5/local_storage'
|
68
|
-
require 'selenium/webdriver/common/html5/session_storage'
|
69
|
-
require 'selenium/webdriver/common/driver_extensions/has_web_storage'
|
70
66
|
require 'selenium/webdriver/common/driver_extensions/downloads_files'
|
71
67
|
require 'selenium/webdriver/common/driver_extensions/has_session_id'
|
72
68
|
require 'selenium/webdriver/common/driver_extensions/has_network_conditions'
|
@@ -28,10 +28,10 @@ module Selenium
|
|
28
28
|
autoload :Request, 'selenium/webdriver/devtools/request'
|
29
29
|
autoload :Response, 'selenium/webdriver/devtools/response'
|
30
30
|
|
31
|
-
def initialize(url:)
|
31
|
+
def initialize(url:, target_type:)
|
32
32
|
@ws = WebSocketConnection.new(url: url)
|
33
33
|
@session_id = nil
|
34
|
-
start_session
|
34
|
+
start_session(target_type: target_type)
|
35
35
|
end
|
36
36
|
|
37
37
|
def close
|
@@ -81,10 +81,12 @@ module Selenium
|
|
81
81
|
|
82
82
|
private
|
83
83
|
|
84
|
-
def start_session
|
84
|
+
def start_session(target_type:)
|
85
85
|
targets = target.get_targets.dig('result', 'targetInfos')
|
86
|
-
|
87
|
-
|
86
|
+
found_target = targets.find { |target| target['type'] == target_type }
|
87
|
+
raise Error::WebDriverError, "Target type '#{target_type}' not found" unless found_target
|
88
|
+
|
89
|
+
session = target.attach_to_target(target_id: found_target['targetId'], flatten: true)
|
88
90
|
@session_id = session.dig('result', 'sessionId')
|
89
91
|
end
|
90
92
|
|
@@ -296,68 +296,6 @@ module Selenium
|
|
296
296
|
execute :take_element_screenshot, id: element
|
297
297
|
end
|
298
298
|
|
299
|
-
#
|
300
|
-
# HTML 5
|
301
|
-
#
|
302
|
-
|
303
|
-
def local_storage_item(key, value = nil)
|
304
|
-
WebDriver.logger.deprecate('local_storage_item(key, value)', id: :local_storage_item)
|
305
|
-
if value
|
306
|
-
execute_script("localStorage.setItem('#{key}', '#{value}')")
|
307
|
-
else
|
308
|
-
execute_script("return localStorage.getItem('#{key}')")
|
309
|
-
end
|
310
|
-
end
|
311
|
-
|
312
|
-
def remove_local_storage_item(key)
|
313
|
-
WebDriver.logger.deprecate('remove_local_storage_item(key)', id: :remove_local_storage_item)
|
314
|
-
execute_script("localStorage.removeItem('#{key}')")
|
315
|
-
end
|
316
|
-
|
317
|
-
def local_storage_keys
|
318
|
-
WebDriver.logger.deprecate('local_storage_keys', id: :local_storage_keys)
|
319
|
-
execute_script('return Object.keys(localStorage)')
|
320
|
-
end
|
321
|
-
|
322
|
-
def clear_local_storage
|
323
|
-
WebDriver.logger.deprecate('clear_local_storage', id: :clear_local_storage)
|
324
|
-
execute_script('localStorage.clear()')
|
325
|
-
end
|
326
|
-
|
327
|
-
def local_storage_size
|
328
|
-
WebDriver.logger.deprecate('local_storage_size', id: :local_storage_size)
|
329
|
-
execute_script('return localStorage.length')
|
330
|
-
end
|
331
|
-
|
332
|
-
def session_storage_item(key, value = nil)
|
333
|
-
WebDriver.logger.deprecate('session_storage_item(key, value)', id: :session_storage_item)
|
334
|
-
if value
|
335
|
-
execute_script("sessionStorage.setItem('#{key}', '#{value}')")
|
336
|
-
else
|
337
|
-
execute_script("return sessionStorage.getItem('#{key}')")
|
338
|
-
end
|
339
|
-
end
|
340
|
-
|
341
|
-
def remove_session_storage_item(key)
|
342
|
-
WebDriver.logger.deprecate('remove_session_storage_item(key)', id: :remove_session_storage_item)
|
343
|
-
execute_script("sessionStorage.removeItem('#{key}')")
|
344
|
-
end
|
345
|
-
|
346
|
-
def session_storage_keys
|
347
|
-
WebDriver.logger.deprecate('session_storage_keys', id: :session_storage_keys)
|
348
|
-
execute_script('return Object.keys(sessionStorage)')
|
349
|
-
end
|
350
|
-
|
351
|
-
def clear_session_storage
|
352
|
-
WebDriver.logger.deprecate('clear_session_storage', id: :clear_session_storage)
|
353
|
-
execute_script('sessionStorage.clear()')
|
354
|
-
end
|
355
|
-
|
356
|
-
def session_storage_size
|
357
|
-
WebDriver.logger.deprecate('session_storage_size', id: :session_storage_size)
|
358
|
-
execute_script('return sessionStorage.length')
|
359
|
-
end
|
360
|
-
|
361
299
|
#
|
362
300
|
# javascript execution
|
363
301
|
#
|
@@ -385,6 +323,8 @@ module Selenium
|
|
385
323
|
end
|
386
324
|
|
387
325
|
def delete_cookie(name)
|
326
|
+
raise ArgumentError, 'Cookie name cannot be null or empty' if name.nil? || name.strip.empty?
|
327
|
+
|
388
328
|
execute :delete_cookie, name: name
|
389
329
|
end
|
390
330
|
|
@@ -27,8 +27,7 @@ module Selenium
|
|
27
27
|
|
28
28
|
class Driver < WebDriver::Driver
|
29
29
|
EXTENSIONS = [DriverExtensions::HasDebugger,
|
30
|
-
DriverExtensions::HasApplePermissions
|
31
|
-
DriverExtensions::HasWebStorage].freeze
|
30
|
+
DriverExtensions::HasApplePermissions].freeze
|
32
31
|
|
33
32
|
include LocalDriver
|
34
33
|
|
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: 4.
|
4
|
+
version: 4.30.0
|
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: 2025-
|
13
|
+
date: 2025-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: base64
|
@@ -345,7 +345,6 @@ files:
|
|
345
345
|
- lib/selenium/webdriver/common/driver_extensions/has_permissions.rb
|
346
346
|
- lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb
|
347
347
|
- lib/selenium/webdriver/common/driver_extensions/has_session_id.rb
|
348
|
-
- lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb
|
349
348
|
- lib/selenium/webdriver/common/driver_extensions/prints_page.rb
|
350
349
|
- lib/selenium/webdriver/common/driver_extensions/uploads_files.rb
|
351
350
|
- lib/selenium/webdriver/common/driver_finder.rb
|
@@ -355,9 +354,6 @@ files:
|
|
355
354
|
- lib/selenium/webdriver/common/fedcm/account.rb
|
356
355
|
- lib/selenium/webdriver/common/fedcm/dialog.rb
|
357
356
|
- lib/selenium/webdriver/common/file_reaper.rb
|
358
|
-
- lib/selenium/webdriver/common/html5/local_storage.rb
|
359
|
-
- lib/selenium/webdriver/common/html5/session_storage.rb
|
360
|
-
- lib/selenium/webdriver/common/html5/shared_web_storage.rb
|
361
357
|
- lib/selenium/webdriver/common/interactions/input_device.rb
|
362
358
|
- lib/selenium/webdriver/common/interactions/interaction.rb
|
363
359
|
- lib/selenium/webdriver/common/interactions/interactions.rb
|
@@ -1,38 +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
|
-
#
|
23
|
-
# @api private
|
24
|
-
#
|
25
|
-
|
26
|
-
module DriverExtensions
|
27
|
-
module HasWebStorage
|
28
|
-
def local_storage
|
29
|
-
HTML5::LocalStorage.new @bridge
|
30
|
-
end
|
31
|
-
|
32
|
-
def session_storage
|
33
|
-
HTML5::SessionStorage.new @bridge
|
34
|
-
end
|
35
|
-
end # HasWebStorage
|
36
|
-
end # DriverExtensions
|
37
|
-
end # WebDriver
|
38
|
-
end # Selenium
|
@@ -1,59 +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 HTML5
|
23
|
-
class LocalStorage
|
24
|
-
include SharedWebStorage
|
25
|
-
|
26
|
-
#
|
27
|
-
# @api private
|
28
|
-
#
|
29
|
-
def initialize(bridge)
|
30
|
-
@bridge = bridge
|
31
|
-
end
|
32
|
-
|
33
|
-
def [](key)
|
34
|
-
@bridge.local_storage_item key
|
35
|
-
end
|
36
|
-
|
37
|
-
def []=(key, value)
|
38
|
-
@bridge.local_storage_item key, value
|
39
|
-
end
|
40
|
-
|
41
|
-
def delete(key)
|
42
|
-
@bridge.remove_local_storage_item key
|
43
|
-
end
|
44
|
-
|
45
|
-
def clear
|
46
|
-
@bridge.clear_local_storage
|
47
|
-
end
|
48
|
-
|
49
|
-
def size
|
50
|
-
@bridge.local_storage_size
|
51
|
-
end
|
52
|
-
|
53
|
-
def keys
|
54
|
-
@bridge.local_storage_keys.reverse
|
55
|
-
end
|
56
|
-
end # LocalStorage
|
57
|
-
end # HTML5
|
58
|
-
end # WebDriver
|
59
|
-
end # Selenium
|
@@ -1,61 +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 HTML5
|
23
|
-
class SessionStorage
|
24
|
-
include Enumerable
|
25
|
-
include SharedWebStorage
|
26
|
-
|
27
|
-
def [](key)
|
28
|
-
@bridge.session_storage_item key
|
29
|
-
end
|
30
|
-
|
31
|
-
def []=(key, value)
|
32
|
-
@bridge.session_storage_item key, value
|
33
|
-
end
|
34
|
-
|
35
|
-
def delete(key)
|
36
|
-
@bridge.remove_session_storage_item key
|
37
|
-
end
|
38
|
-
|
39
|
-
def clear
|
40
|
-
@bridge.clear_session_storage
|
41
|
-
end
|
42
|
-
|
43
|
-
def size
|
44
|
-
@bridge.session_storage_size
|
45
|
-
end
|
46
|
-
|
47
|
-
def keys
|
48
|
-
@bridge.session_storage_keys.reverse
|
49
|
-
end
|
50
|
-
|
51
|
-
#
|
52
|
-
# @api private
|
53
|
-
#
|
54
|
-
|
55
|
-
def initialize(bridge)
|
56
|
-
@bridge = bridge
|
57
|
-
end
|
58
|
-
end # SessionStorage
|
59
|
-
end # HTML5
|
60
|
-
end # WebDriver
|
61
|
-
end # Selenium
|
@@ -1,53 +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 HTML5
|
23
|
-
module SharedWebStorage
|
24
|
-
include Enumerable
|
25
|
-
|
26
|
-
def key?(key)
|
27
|
-
keys.include? key
|
28
|
-
end
|
29
|
-
alias member? key?
|
30
|
-
alias has_key? key?
|
31
|
-
|
32
|
-
def fetch(key)
|
33
|
-
return self[key] if key? key
|
34
|
-
return yield(key) if block_given?
|
35
|
-
|
36
|
-
raise KeyError, "missing key #{key.inspect}"
|
37
|
-
end
|
38
|
-
|
39
|
-
def empty?
|
40
|
-
to_a.empty?
|
41
|
-
end
|
42
|
-
|
43
|
-
def each
|
44
|
-
return enum_for(:each) unless block_given?
|
45
|
-
|
46
|
-
keys.each do |k|
|
47
|
-
yield k, self[k]
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end # SharedWebStorage
|
51
|
-
end # HTML5
|
52
|
-
end # WebDriver
|
53
|
-
end # Selenium
|