selenium-webdriver 4.1.0 → 4.28.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.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +446 -1
  3. data/Gemfile +4 -0
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +3 -3
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/windows/selenium-manager.exe +0 -0
  10. data/lib/selenium/server.rb +41 -43
  11. data/lib/selenium/webdriver/atoms/findElements.js +52 -50
  12. data/lib/selenium/webdriver/atoms/getAttribute.js +6 -100
  13. data/lib/selenium/webdriver/atoms/isDisplayed.js +24 -96
  14. data/lib/selenium/webdriver/atoms/mutationListener.js +0 -0
  15. data/lib/selenium/webdriver/atoms.rb +5 -3
  16. data/lib/selenium/webdriver/bidi/browsing_context.rb +100 -0
  17. data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +35 -0
  18. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +35 -0
  19. data/lib/selenium/webdriver/{common/driver_extensions/has_location.rb → bidi/log/filter_by.rb} +14 -11
  20. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +33 -0
  21. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +33 -0
  22. data/lib/selenium/webdriver/bidi/log_handler.rb +65 -0
  23. data/lib/selenium/webdriver/bidi/log_inspector.rb +147 -0
  24. data/lib/selenium/webdriver/bidi/network.rb +82 -0
  25. data/lib/selenium/webdriver/bidi/session.rb +51 -0
  26. data/lib/selenium/webdriver/bidi/struct.rb +42 -0
  27. data/lib/selenium/webdriver/bidi.rb +67 -0
  28. data/lib/selenium/webdriver/chrome/driver.rb +9 -29
  29. data/lib/selenium/webdriver/chrome/features.rb +9 -67
  30. data/lib/selenium/webdriver/chrome/options.rb +3 -223
  31. data/lib/selenium/webdriver/chrome/profile.rb +3 -83
  32. data/lib/selenium/webdriver/chrome/service.rb +5 -19
  33. data/lib/selenium/webdriver/chrome.rb +0 -16
  34. data/lib/selenium/webdriver/chromium/driver.rb +61 -0
  35. data/lib/selenium/webdriver/chromium/features.rb +99 -0
  36. data/lib/selenium/webdriver/chromium/options.rb +243 -0
  37. data/lib/selenium/webdriver/chromium/profile.rb +113 -0
  38. data/lib/selenium/webdriver/chromium.rb +29 -0
  39. data/lib/selenium/webdriver/common/action_builder.rb +60 -22
  40. data/lib/selenium/webdriver/common/child_process.rb +136 -0
  41. data/lib/selenium/webdriver/common/driver.rb +54 -89
  42. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
  43. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +0 -1
  44. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
  45. data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +0 -2
  46. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +0 -2
  47. data/lib/selenium/webdriver/common/driver_extensions/{has_remote_status.rb → has_bidi.rb} +10 -5
  48. data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +10 -1
  49. data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +0 -2
  50. data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +1 -4
  51. data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
  52. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +0 -2
  53. data/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb +55 -0
  54. data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +65 -0
  55. data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +0 -2
  56. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +9 -3
  57. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +0 -2
  58. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +8 -68
  59. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +0 -2
  60. data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +1 -3
  61. data/lib/selenium/webdriver/common/driver_finder.rb +97 -0
  62. data/lib/selenium/webdriver/common/element.rb +8 -8
  63. data/lib/selenium/webdriver/common/error.rb +29 -4
  64. data/lib/selenium/webdriver/common/fedcm/account.rb +49 -0
  65. data/lib/selenium/webdriver/common/fedcm/dialog.rb +74 -0
  66. data/lib/selenium/webdriver/common/fedcm.rb +27 -0
  67. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
  68. data/lib/selenium/webdriver/common/interactions/input_device.rb +10 -4
  69. data/lib/selenium/webdriver/common/interactions/interaction.rb +12 -25
  70. data/lib/selenium/webdriver/common/interactions/interactions.rb +24 -4
  71. data/lib/selenium/webdriver/common/interactions/key_actions.rb +5 -1
  72. data/lib/selenium/webdriver/common/interactions/key_input.rb +11 -27
  73. data/lib/selenium/webdriver/common/interactions/none_input.rb +10 -8
  74. data/lib/selenium/webdriver/common/interactions/pause.rb +49 -0
  75. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +59 -71
  76. data/lib/selenium/webdriver/common/{driver_extensions/has_network_connection.rb → interactions/pointer_cancel.rb} +19 -11
  77. data/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb +63 -0
  78. data/lib/selenium/webdriver/common/interactions/pointer_input.rb +15 -84
  79. data/lib/selenium/webdriver/common/interactions/pointer_move.rb +60 -0
  80. data/lib/selenium/webdriver/common/interactions/pointer_press.rb +85 -0
  81. data/lib/selenium/webdriver/common/interactions/scroll.rb +59 -0
  82. data/lib/selenium/webdriver/common/interactions/scroll_origin.rb +48 -0
  83. data/lib/selenium/webdriver/common/interactions/typing_interaction.rb +54 -0
  84. data/lib/selenium/webdriver/common/interactions/wheel_actions.rb +114 -0
  85. data/lib/selenium/webdriver/common/interactions/wheel_input.rb +42 -0
  86. data/lib/selenium/webdriver/common/keys.rb +1 -0
  87. data/lib/selenium/webdriver/common/local_driver.rb +53 -0
  88. data/lib/selenium/webdriver/common/logger.rb +93 -28
  89. data/lib/selenium/webdriver/common/manager.rb +2 -29
  90. data/lib/selenium/webdriver/common/network.rb +64 -0
  91. data/lib/selenium/webdriver/common/options.rb +19 -19
  92. data/lib/selenium/webdriver/common/platform.rb +12 -52
  93. data/lib/selenium/webdriver/common/port_prober.rb +1 -1
  94. data/lib/selenium/webdriver/common/profile_helper.rb +1 -1
  95. data/lib/selenium/webdriver/common/proxy.rb +4 -4
  96. data/lib/selenium/webdriver/common/script.rb +45 -0
  97. data/lib/selenium/webdriver/common/search_context.rb +10 -8
  98. data/lib/selenium/webdriver/common/selenium_manager.rb +104 -0
  99. data/lib/selenium/webdriver/common/service.rb +24 -26
  100. data/lib/selenium/webdriver/common/service_manager.rb +9 -15
  101. data/lib/selenium/webdriver/common/shadow_root.rb +2 -3
  102. data/lib/selenium/webdriver/common/socket_lock.rb +3 -3
  103. data/lib/selenium/webdriver/common/socket_poller.rb +3 -3
  104. data/lib/selenium/webdriver/common/takes_screenshot.rb +6 -5
  105. data/lib/selenium/webdriver/common/target_locator.rb +5 -5
  106. data/lib/selenium/webdriver/common/timeouts.rb +2 -2
  107. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +85 -0
  108. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +72 -0
  109. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +62 -0
  110. data/lib/selenium/webdriver/common/wait.rb +1 -1
  111. data/lib/selenium/webdriver/common/websocket_connection.rb +176 -0
  112. data/lib/selenium/webdriver/common/window.rb +6 -6
  113. data/lib/selenium/webdriver/common/zipper.rb +1 -1
  114. data/lib/selenium/webdriver/common.rb +27 -5
  115. data/lib/selenium/webdriver/devtools/console_event.rb +0 -2
  116. data/lib/selenium/webdriver/devtools/exception_event.rb +0 -2
  117. data/lib/selenium/webdriver/devtools/mutation_event.rb +0 -2
  118. data/lib/selenium/webdriver/devtools/network_interceptor.rb +173 -0
  119. data/lib/selenium/webdriver/devtools/pinned_script.rb +0 -2
  120. data/lib/selenium/webdriver/devtools/request.rb +1 -3
  121. data/lib/selenium/webdriver/devtools/response.rb +1 -3
  122. data/lib/selenium/webdriver/devtools.rb +17 -114
  123. data/lib/selenium/webdriver/edge/driver.rb +9 -3
  124. data/lib/selenium/webdriver/edge/features.rb +8 -4
  125. data/lib/selenium/webdriver/edge/options.rb +17 -5
  126. data/lib/selenium/webdriver/edge/profile.rb +2 -2
  127. data/lib/selenium/webdriver/edge/service.rb +8 -7
  128. data/lib/selenium/webdriver/edge.rb +0 -2
  129. data/lib/selenium/webdriver/firefox/driver.rb +9 -2
  130. data/lib/selenium/webdriver/firefox/features.rb +11 -7
  131. data/lib/selenium/webdriver/firefox/options.rb +10 -16
  132. data/lib/selenium/webdriver/firefox/profile.rb +21 -17
  133. data/lib/selenium/webdriver/firefox/profiles_ini.rb +1 -1
  134. data/lib/selenium/webdriver/firefox/service.rb +1 -18
  135. data/lib/selenium/webdriver/firefox/util.rb +46 -0
  136. data/lib/selenium/webdriver/firefox.rb +1 -14
  137. data/lib/selenium/webdriver/ie/driver.rb +7 -1
  138. data/lib/selenium/webdriver/ie/features.rb +34 -0
  139. data/lib/selenium/webdriver/ie/options.rb +6 -4
  140. data/lib/selenium/webdriver/ie/service.rb +1 -22
  141. data/lib/selenium/webdriver/ie.rb +4 -17
  142. data/lib/selenium/webdriver/remote/bidi_bridge.rb +66 -0
  143. data/lib/selenium/webdriver/remote/{commands.rb → bridge/commands.rb} +22 -9
  144. data/lib/selenium/webdriver/remote/bridge/locator_converter.rb +76 -0
  145. data/lib/selenium/webdriver/remote/bridge.rb +158 -100
  146. data/lib/selenium/webdriver/remote/capabilities.rb +5 -55
  147. data/lib/selenium/webdriver/remote/driver.rb +35 -14
  148. data/lib/selenium/webdriver/remote/features.rb +75 -0
  149. data/lib/selenium/webdriver/remote/http/common.rb +26 -6
  150. data/lib/selenium/webdriver/remote/http/curb.rb +10 -6
  151. data/lib/selenium/webdriver/remote/http/default.rb +8 -14
  152. data/lib/selenium/webdriver/remote/response.rb +14 -22
  153. data/lib/selenium/webdriver/remote/server_error.rb +2 -2
  154. data/lib/selenium/webdriver/remote.rb +3 -2
  155. data/lib/selenium/webdriver/safari/driver.rb +7 -1
  156. data/lib/selenium/webdriver/safari/features.rb +5 -3
  157. data/lib/selenium/webdriver/safari/options.rb +5 -1
  158. data/lib/selenium/webdriver/safari/service.rb +10 -4
  159. data/lib/selenium/webdriver/safari.rb +1 -15
  160. data/lib/selenium/webdriver/support/color.rb +22 -22
  161. data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
  162. data/lib/selenium/webdriver/support/guards/guard.rb +14 -14
  163. data/lib/selenium/webdriver/support/guards/guard_condition.rb +1 -3
  164. data/lib/selenium/webdriver/support/guards.rb +4 -4
  165. data/lib/selenium/webdriver/support/relative_locator.rb +0 -1
  166. data/lib/selenium/webdriver/support/select.rb +3 -1
  167. data/lib/selenium/webdriver/version.rb +1 -1
  168. data/lib/selenium/webdriver.rb +7 -5
  169. data/selenium-webdriver.gemspec +22 -16
  170. metadata +137 -47
  171. data/lib/selenium/webdriver/remote/http/persistent.rb +0 -65
  172. data/lib/selenium/webdriver/support/cdp/domain.rb.erb +0 -63
  173. data/lib/selenium/webdriver/support/cdp_client_generator.rb +0 -108
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40e4bef1fdee7ae817c56466ec231be400d677d56a8c8f46b797c6b3eba28de9
4
- data.tar.gz: a9c1af31f12db6096f06c2a89e487e40ea2bb53b8f6e46e5f77a3046f149bb34
3
+ metadata.gz: 71aab5006f9982b59f81f1ba39119f70b84fec2603143f4445f4e0d8752169e5
4
+ data.tar.gz: 79dcff0ad7a8a73789a7e4bbc415098736aaa21f292be121bae398c71f086434
5
5
  SHA512:
6
- metadata.gz: b5325d0fe9f5fdb721ed4a6daa1384d7876dc7a072dd52f46c73d76b1614434c123fff2b4a9d7de01538968eddfbad57f2e1a87f4dce0e560a850dcf21988840
7
- data.tar.gz: 3b345ac66d051c32267d1c4ef9b2dd70aea36e2c4e5bb35ce30197d748effca8fed460824d1961ad5a39340358fc9be3f200708a38557e5e878b09be1b0d61c0
6
+ metadata.gz: d72ff0f3a97097dd479ad3bf0e7ad5f4d9b58d8c40545afd912ae0e211727ffd5da1cd3d52a8ec2973f8f86694424fd89ebb6fc394bac1171f6682ef5af6a6dd
7
+ data.tar.gz: 9e21d1c768e945fb445d652a49f85a05f9e85e3cb1f5f60eed5b213fec43562857702a12c8624a3523e381082990ff87bc521519930a85bc3f708cd05c71967c
data/CHANGES CHANGED
@@ -1,4 +1,449 @@
1
- 4.1.0 (2021-11-18)
1
+ 4.28.0 (2025-01-16)
2
+ =========================
3
+ * Add CDP for Chrome 132 and remove 129
4
+ * [ci] Bumping versions for nightly
5
+ * [rb] Add tests for the cookie named, and updates type (#14843)
6
+ * [rb] Update note for return value of Hash (#14845)
7
+ * [rb] BiDi Network: add_request_handler, remove_request_handler, clear_request_handlers (#14751)
8
+ * Update supported versions for Chrome DevTools
9
+
10
+ 4.27.0 (2024-11-21)
11
+ =========================
12
+ * Add CDP for Chrome 131 and remove 128
13
+ * Add Firefox CDP deprecation warnings (#14763)
14
+ * Add Bidi network commands for authentication and interception (#14523)
15
+ * Handle graceful webdriver shutdown (#14430)
16
+ * Reduce RBS errors to 0 (#14661)
17
+ * Resolve `uri` gem deprecation warning (#14770)
18
+ * Update minimum Ruby to 3.1 (#14685)
19
+ * Implement navigation commands with BiDi (#14094)
20
+
21
+ 4.26.0 (2024-10-28)
22
+ =========================
23
+ * Add CDP for Chrome 130 and remove 127
24
+ * Add missing RBS methods (#14621)
25
+ * Update Ruby BiDi script structs to match spec
26
+ * Add RBS type support for BiDi related classes (#14611)
27
+
28
+ 4.25.0 (2024-09-19)
29
+ =========================
30
+ * Add CDP for Chrome 129 and remove 126
31
+ * Fix add_cause method not being able to process an array of hashes (#14433)
32
+ * replace `fedcm` links with new ones (#14478)
33
+ * Allow driver path to be set using ENV variables (#14287)
34
+
35
+ 4.24.0 (2024-08-23)
36
+ =========================
37
+ * Deprecate WebStorage JS methods (#14276)
38
+ * BUGFIX: Add stamp to nightly build (#14320)
39
+ * Add timeout and tests for curb, also added the gem curb that was not part of selenium (#14285)
40
+ * Add CDP for Chrome 128 and remove 125
41
+
42
+ 4.23.0 (2024-07-18)
43
+ =========================
44
+ * Add FedCM support to the ruby selenium client (#13796)
45
+ * Add URLs constant to update error messages (#14174)
46
+ * Update selenium manager types (#14189)
47
+ * Add backtrace locations and cause to errors (#14170)
48
+ * Add CDP for Chrome 127 and remove 124
49
+
50
+ 4.22.0 (2024-06-20)
51
+ =========================
52
+
53
+ * Force UTF-8 encoding on logger (see #6937)
54
+ * Don't crash when ChildProcess is already killed (see #14032)
55
+ * Manage bidi instance on the bridge not the driver (#14071)
56
+ * Implement High Level Logging API with BiDi (#14073)
57
+ * Fix bug with message deletion in Guard class
58
+ * Change output for Guard class
59
+ * Implement toggle for BiDi and Classic implementations (#14092)
60
+ * Add preference to enable CDP in Firefox by default (#14091)
61
+ * Add support for the w3c silent option for the ruby library (#14152)
62
+ * Add CDP for Chrome 126 and remove 123
63
+
64
+ 4.21.1 (2024-05-16)
65
+ =========================
66
+
67
+ * Fixed missing Chrome binary error in Rails system tests.
68
+
69
+ 4.21.0 (2024-05-16)
70
+ =========================
71
+
72
+ * Add CDP for Chrome 125 and remove 122
73
+ * Initial extensibility points for Appium
74
+ * Support registering extra headers in HTTP client
75
+ * Support overriding User-Agent in HTTP client
76
+ * Support registering extra bridge commands
77
+ * Support overriding default locator conversion
78
+ * Support registering custom finders for SearchContext
79
+ * Support using custom element classes
80
+
81
+ 4.20.1 (2024-04-25)
82
+ =========================
83
+
84
+ * Returned accidentally removed DriverFinder.path and deprecated it.
85
+
86
+ 4.20.0 (2024-04-24)
87
+ =========================
88
+
89
+ * Add CDP for Chrome 124 and remove 121
90
+ * Making Selenium Manager a thin wrapper (#13386)
91
+ * This change has been made to make it easier to maintain and improve, the interface has
92
+ changed and if users were invoking it, they might experience issues. Selenium Manager is
93
+ still in beta and these type of changes are expected.
94
+
95
+ 4.19.0 (2024-03-27)
96
+ =========================
97
+
98
+ * Add CDP for Chrome 123 and remove 120
99
+ * Avoid over-escaping browser path (#13632)
100
+ * Add full RBS support (#13234)
101
+
102
+ 4.18.1 (2024-02-19)
103
+ =========================
104
+
105
+ * Add CDP for Chrome 122 and remove 119
106
+
107
+ 4.18.0 (2024-02-19)
108
+ =========================
109
+
110
+ * Update documentation link in readme (#13570)
111
+ * make suggested updates from rubocop
112
+
113
+ 4.17.0 (2024-01-22)
114
+ =========================
115
+
116
+ * Logger defaults output to stderr instead of stdout
117
+ * Fully support Chrome 120+ old headless mode (#13271)
118
+ * Add ruby to Selenium Manager input for tracking (see #13288)
119
+ * Define default command_list (fixes #13307)
120
+ * Fix issues with incorrectly named edge browser
121
+ * Check for whether driver supports full page screenshots to error (#12799)
122
+ * Add CDP for Chrome 121 and remove 118
123
+
124
+ 4.16.0 (2023-12-06)
125
+ =========================
126
+
127
+ Ruby:
128
+ * Add RBS files to Ruby (#12844)
129
+ * Convert binary locations for cygwin (#12618)
130
+ * Allow Selenium Manager to work with Unix (#13161)
131
+ * Extend RBS support for logger and log entry (#13192)
132
+ * Update rules_ruby to the latest version (#13235)
133
+
134
+ BiDi:
135
+ * Released selenium-devtools 0.120.0 (supports CDP v85, v118, v119, v120)
136
+
137
+ Chrome:
138
+ * Fix http proxy configuration for chrome (#13093)
139
+
140
+ Firefox:
141
+ * Delete 'lock' file in FF profile (#13090)
142
+
143
+ 4.15.0 (2023-11-01)
144
+ =========================
145
+
146
+ * Do not set browser binary in selenium manager if it is an empty string (#12738)
147
+ * Add flaky condition to guards to mark unreliable tests
148
+ * Rake update needs to build latest grid for running remote tests
149
+ * Add CDP v119 and remove v116
150
+ * Implement file downloads (#12979)
151
+
152
+ 4.14.0 (2023-10-09)
153
+ =========================
154
+ Ruby:
155
+ * allow users to access the full script of the atom directly
156
+
157
+ BiDi:
158
+ * Released selenium-devtools 0.118.0 (supports CDP v85, v116, v117, v118)
159
+
160
+ 4.13.1 (2023-09-25)
161
+ =========================
162
+ Ruby:
163
+ * Fix bug preventing logging chromedriver to file
164
+
165
+ 4.13.0 (2023-09-25)
166
+ =========================
167
+ Ruby:
168
+ * Fix bug preventing using performance logging with chromium
169
+ * Allow users to set Selenium Manager path by environment variable (#12752)
170
+ * Allow service to be started before the driver
171
+ * remove deprecated driver extensions for location and network connection
172
+
173
+ BiDi:
174
+ * Released selenium-devtools 0.117.0 (supports CDP v85, v115, v116, v117)
175
+
176
+ 4.12.0 (2023-08-31)
177
+ =========================
178
+ Ruby:
179
+ * Fix bug preventing good error messages in Selenium Manager when stdout empty
180
+ * Fix bug with Firefox not loading net/http library by default (#12506)
181
+ * Remove support for using capabilities in local drivers
182
+
183
+ BiDi:
184
+ * Released selenium-devtools 0.116.0 (supports CDP v85, v114, v115, v116)
185
+
186
+ 4.11.0 (2023-07-31)
187
+ =========================
188
+ Ruby:
189
+ * Made network interception threads fail silently (#12226)
190
+ * Have Selenium Manager binary locate drivers on PATH (#12345)
191
+ * Add browser output from selenium manager to options (#12398)
192
+ * Remove deprecated code (#12417)
193
+ BiDi:
194
+ * Released selenium-devtools 0.115.0 (supports CDP v85, v113, v114, v115)
195
+ Edge:
196
+ * Adding ignore process match for IE Mode across bindings (#12279)
197
+
198
+ 4.10.0 (2023-06-07)
199
+ =========================
200
+ Ruby:
201
+ * Implement proxy support for Selenium Manager
202
+ * Prevent setting driver log level in Safari
203
+ * Change all Selenium Manager logging to :debug (#12145)
204
+ * Error messages include links to documentation
205
+ * Add custom error class for driver location and improve error logic
206
+
207
+ BiDi:
208
+ * Released selenium-devtools 0.114.0 (supports CDP v85, v112, v113, v114)
209
+
210
+ Edge:
211
+ * Add support for webview2
212
+
213
+ 4.9.1 (2023-05-08)
214
+ =========================
215
+ Ruby:
216
+ * Allow users to specify driver process output in Service class (#11964)
217
+ * Updated minimum required Ruby version to 3.0
218
+ * Selenium Logger defaults to :info and all debugging is now logged as :debug (#11967)
219
+ * Every logging entry can be ignored based on ID, not just warnings
220
+ * Logging entries can be filtered to allow or ignore specific IDs
221
+
222
+ BiDi:
223
+ * Fix bug with loading devtools (#11931) (thanks Boris Petrov!)
224
+ * Released selenium-devtools 0.113.0 (supports CDP v85, v111, v112, v113)
225
+
226
+ 4.9.0 (2023-04-21)
227
+ =========================
228
+ Ruby:
229
+ * Fix devtools version fallback (#11869)
230
+ * Fix bug in selenium manager escaping back slashes in Windows (#11884)
231
+
232
+ BiDi:
233
+ * Released selenium-devtools 0.112.0 (supports CDP v85, v110, v111, v112)
234
+
235
+ 4.8.6 (2023-03-29)
236
+ =========================
237
+ Ruby:
238
+ * Properly escape arguments passed to Selenium Manager
239
+
240
+ 4.8.5 (2023-03-28)
241
+ =========================
242
+ Ruby:
243
+ * Wrapping browser name in quotes when calling Selenium Manager
244
+
245
+ 4.8.4 (2023-03-28)
246
+ =========================
247
+ Ruby:
248
+ * Update the selenium-manager versions to fix an IE naming issue (#11828)
249
+
250
+ 4.8.3 (2023-03-26)
251
+ =========================
252
+ Ruby:
253
+ * Still need to use driver finder when using capabilities parameter
254
+ * Accommodate Driver Finder being sent something other than an Options instance
255
+
256
+ 4.8.2 (2023-03-24)
257
+ =========================
258
+ Ruby:
259
+ * Ruby driver finder (#11523)
260
+ * Using json output with Selenium Manager
261
+
262
+ BiDi:
263
+ * Released selenium-devtools 0.111.0 (supports CDP v85, v109, v110, v111)
264
+
265
+ 4.8.1 (2023-02-17)
266
+ =========================
267
+ Ruby:
268
+ * Fix autoload of WebDriver::Remote::Bridge::COMMANDS
269
+ * Subclass is setting value before the superclass is setting it to nil
270
+ * Updating Selenium Manager binaries for 4.8.1 release
271
+
272
+ BiDi:
273
+ * Released selenium-devtools 0.110.0 (supports CDP v85, v108, v109, v110)
274
+ * Close BiDi session on closing the last top-level browsing context
275
+ * Add filtering capability to LogInspector
276
+
277
+ 4.8.0 (2023-01-23)
278
+ =========================
279
+ Ruby:
280
+ * Allow updating instance variables on service classes
281
+ * Deprecate extract_service_args processing in service classes
282
+ * Fix bug preventing sending nil to #send_keys with Remote Driver
283
+ * Fix bug with IE specific methods not available to IE Driver
284
+ * Created Chromium superclass for Chrome and Edge
285
+ * Deprecated platform and version setters/getters in Capabilities class
286
+ * Revamped driver constructor logic
287
+ * Fix bug preventing using Safari Technology Preview when using SafariOptions
288
+ * Fix bug preventing more than one driver type to access Selenium Manager
289
+ * Defaults to using Options instead of Capabilities
290
+ * Make Options classes more strict for allowed arguments and types
291
+ * Removed previously deprecated actions class parameters
292
+ * Removed Location struct
293
+ * Add comment with name of large JS executions (#11038)
294
+ * update logger with link on how to use it (#11478)
295
+ * Deprecate #add_option for Option classes in favor of constructor and attr_accessor
296
+ * Deprecate all unrecognized capabilities for Options classes
297
+ * Deprecate support for :capabilities for local drivers
298
+ * Deprecate browser class methods for Capabilities
299
+ * Deprecate #headless! for Chrome and Firefox
300
+
301
+ BiDi:
302
+ * Released selenium-devtools 0.109.0 (supports CDP v85, v107, v108, v109)
303
+ * Add LogInspector (#11368)
304
+ * Add Browsing context commands (#11446)
305
+
306
+ 4.7.1 (2022-12-02)
307
+ =========================
308
+ Ruby:
309
+ * Fix bug preventing selenium manager from using Internet Explorer
310
+
311
+ 4.7.0 (2022-12-01)
312
+ =========================
313
+ BiDi:
314
+ * Released selenium-devtools 0.108.0 (supports CDP v85, v106, v107, v108)
315
+ * Fix bug with socket stability
316
+
317
+ Ruby:
318
+ * Remove dependency on ChildProcess gem in favor of native Process.spawn (#11251)
319
+ * Add support for Selenium Manager to work with IE Driver
320
+ * Improve error handling for Selenium Manager
321
+
322
+ Safari:
323
+ * Fix bug preventing Safari Options from being used with Safari Technology Preview
324
+
325
+ 4.6.1 (2022-11-04)
326
+ =========================
327
+ Ruby:
328
+ * fix bug preventing selenium-manager from being executable by default
329
+
330
+ 4.6.0 (2022-11-04)
331
+ =========================
332
+ BiDi:
333
+ * Released selenium-devtools 0.107.0 (supports CDP v85, v105, v106, v107)
334
+
335
+ Ruby:
336
+ * firefox scroll by amount is only failing on mac
337
+ * add initial support for selenium manager
338
+ * Revert "[rb] do not allow Select class to work with disabled selects"
339
+ * Make sure selenium-manager is packed into gem
340
+ * Fix platform list in #scroll_by guard
341
+
342
+ 4.5.0 (2022-09-28)
343
+ =========================
344
+
345
+ BiDi:
346
+ * Released selenium-devtools 0.105.0 (supports CDP v85, v103, v104, v105)
347
+ * Released selenium-devtools 0.106.0 (supports CDP v85, v104, v105, v106)
348
+ * Add HasBiDi support to Chrome
349
+
350
+ Ruby:
351
+ * Fix bug in Platform code
352
+ * Update Select class to error when elements are disabled (#10812)
353
+
354
+ Firefox:
355
+ * Add support for installing unsigned add-ons (#10265, thanks TamsilAmani!)
356
+ * Change accept_insecure_certificates to true by default (to match other bindings)
357
+ * Set debugger_address option to true by default
358
+
359
+ Server:
360
+ * Add support for initializing server class with arguments and log level
361
+
362
+ 4.4.0 (2022-08-09)
363
+ =========================
364
+
365
+ BiDi:
366
+ * Released selenium-devtools 0.103.1 to fix websocket dependency requirement
367
+ * Released selenium-devtools 0.104.0 (supports CDP v85, v102, v103, v104)
368
+ * Have network interceptor ignore cancelled requests (#10856)
369
+ * Improve websocket message handling
370
+
371
+ Chromium:
372
+ * Prevent users from setting w3c: false and warn for true (thanks Tamsil Amani!)
373
+
374
+ Ruby:
375
+ * Implement Virtual Authenticator (#10903, #10541) (thanks Tamsil Amani!)
376
+
377
+ 4.3.0 (2022-06-23)
378
+ =========================
379
+
380
+ BiDi:
381
+ * Released selenium-devtools 0.103.0 (supports CDP v85, v101, v102, v103)
382
+
383
+ Ruby:
384
+ * Allow specifying which button is clicked in pointer action class methods
385
+ * Remove deprecated `Persistent` http class
386
+ * Remove deprecated HasRemoteStatus module
387
+ * Remove deprecated `Manager#new_window` and `Manager#logs`
388
+ * `ActionBuilder#move_to` no longer attempts to move to top left corner of element
389
+ * Remove deprecated support for sending Service parameters directly to Driver constructor
390
+ * Remove deprecated setters and getters for driver path on Browser modules
391
+ * Remove deprecated support for passing in options argument to Options class
392
+ * Allow `:options` parameter to take `Options` instance argument like other languages
393
+ * Remove deprecated support for `:desired_capabilities` & `:options` with `Hash` argument
394
+
395
+ 4.2.1 (2022-05-31)
396
+ =========================
397
+
398
+ Ruby
399
+ * Fix bug in setting default duration in Actions constructor
400
+
401
+ 4.2.0 (2022-05-27)
402
+ =========================
403
+
404
+ BiDi:
405
+ * Released selenium-devtools 0.97.0 (supports CDP v85, v95, v96, v97)
406
+ * Released selenium-devtools 0.98.0 (supports CDP v85, v96, v97, v98)
407
+ * Released selenium-devtools 0.99.0 (supports CDP v85, v97, v98, v99)
408
+ * Released selenium-devtools 0.100.0 (supports CDP v85, v98, v99, v100)
409
+ * Released selenium-devtools 0.101.0 (supports CDP v85, v99, v100, v101)
410
+ * Released selenium-devtools 0.102.0 (supports CDP v85, v100, v101, v102)
411
+ * Implement simple BiDi connection
412
+ * Fix bug in initial BiDi implementation (thanks Boris Petrov!)
413
+ * Fix bug with mutating headers in request interception (#10574)
414
+ * Fix bug with empty response headers (thanks Viren Negi!)
415
+
416
+ Firefox:
417
+ * Add support to Firefox Options for environment capability
418
+ * Use addon parameter instead of path parameter to avoid using file detector
419
+ * Restore #from_name method to Firefox profile (#10146)
420
+
421
+ Chromium:
422
+ * Add support for casting desktop
423
+
424
+ Ruby:
425
+ * Updated minimum required Ruby version to 2.7
426
+ * Fix bug by not attempting to stop service process when it's not started (#10015)
427
+ * Fix bug to not stop service process when it's not started (thanks Atsushi Tatsuma!)
428
+ * Use driver endpoint to get page source instead of JavaScript
429
+ * Add zenkaku_hankaku key support
430
+ * Fix download support of Selenium Server
431
+ * Do not convert Tag Name to CSS Selector
432
+
433
+ ActionBuilder:
434
+ * Raise error if input device not found
435
+ * Move `TypingInteraction` from `Interactions::KeyInput` to `Interactions` module
436
+ * Throw better errors for `PointerInput` methods
437
+ * Allow each action interaction class to validate its own source
438
+ * Set all Interactions classes to private
439
+ * Allow device names to use a default id if one is not specified
440
+ * Deprecate default mouse and keyboard values in constructor, favoring devices parameter
441
+ * Add support for pointer event properties
442
+ * Implement scroll wheel support
443
+ * Deprecate ordered pair parameters for pause method in favor of keywords
444
+ * Deprecate move to element with offset changing origin to top left of element
445
+
446
+ 4.1.0 (2021-11-22)
2
447
  =========================
3
448
 
4
449
  DevTools:
data/Gemfile CHANGED
@@ -4,3 +4,7 @@ source 'https://rubygems.org'
4
4
  Dir["#{__dir__}/*.gemspec"].each do |spec|
5
5
  gemspec name: File.basename(spec, '.gemspec')
6
6
  end
7
+
8
+ gem 'curb', '~> 1.0.5', require: false, platforms: %i[mri mingw x64_mingw]
9
+ gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
10
+ gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
data/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2021 Software Freedom Conservancy (SFC)
190
+ Copyright 2025 Software Freedom Conservancy (SFC)
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
data/NOTICE CHANGED
@@ -1,2 +1,2 @@
1
- Copyright 2011-2021 Software Freedom Conservancy
1
+ Copyright 2011-2025 Software Freedom Conservancy
2
2
  Copyright 2004-2011 Selenium committers
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # selenium-webdriver
2
2
 
3
- This gem provides Ruby bindings for Selenium and supports MRI >= 2.6
3
+ This gem provides Ruby bindings for Selenium and supports MRI >= 3.1.
4
4
 
5
5
  ## Install
6
6
 
@@ -10,12 +10,12 @@ This gem provides Ruby bindings for Selenium and supports MRI >= 2.6
10
10
 
11
11
  * https://rubygems.org/gems/selenium-webdriver
12
12
  * https://www.selenium.dev/selenium/docs/api/rb/index.html
13
- * https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings
13
+ * https://www.selenium.dev/documentation/?tab=ruby
14
14
  * https://github.com/SeleniumHQ/selenium/issues
15
15
 
16
16
  ## License
17
17
 
18
- Copyright 2009-2021 Software Freedom Conservancy
18
+ Copyright 2009-2024 Software Freedom Conservancy
19
19
 
20
20
  Licensed to the Software Freedom Conservancy (SFC) under one
21
21
  or more contributor license agreements. See the NOTICE file
Binary file
Binary file
Binary file
@@ -17,7 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- require 'childprocess'
20
+ require 'selenium/webdriver/common/child_process'
21
+ require 'selenium/webdriver/common/port_prober'
21
22
  require 'selenium/webdriver/common/socket_poller'
22
23
  require 'net/http'
23
24
 
@@ -84,15 +85,15 @@ module Selenium
84
85
  return download_file_name if File.exist? download_file_name
85
86
 
86
87
  begin
87
- server = 'https://github.com/seleniumhq/selenium/releases/download'
88
- released = Net::HTTP.get_response(URI.parse("#{server}/selenium-#{required_version}/#{download_file_name}"))
88
+ download_location = available_assets[download_file_name]['browser_download_url']
89
+ released = Net::HTTP.get_response(URI.parse(download_location))
89
90
  redirected = URI.parse released.header['location']
90
91
 
91
92
  File.open(download_file_name, 'wb') do |destination|
92
93
  download_server(redirected, destination)
93
94
  end
94
95
  rescue StandardError
95
- FileUtils.rm download_file_name if File.exist? download_file_name
96
+ FileUtils.rm_rf download_file_name
96
97
  raise
97
98
  end
98
99
 
@@ -105,26 +106,31 @@ module Selenium
105
106
 
106
107
  def latest
107
108
  @latest ||= begin
108
- net_http_start('api.github.com') do |http|
109
- json = http.get('/repos/seleniumhq/selenium/releases').body
110
- all_assets = JSON.parse(json).map { |release| release['assets'] }.flatten
111
- server_assets = all_assets.map { |asset| asset['name'][/selenium-server-(\d+\.\d+\.\d+)\.jar/, 1] }.compact
112
- server_assets.map { |version| Gem::Version.new(version) }.max.version
113
- end
109
+ available = available_assets.keys.map { |key| key[/selenium-server-(\d+\.\d+\.\d+)\.jar/, 1] }
110
+ available.map { |asset| Gem::Version.new(asset) }.max.to_s
114
111
  end
115
112
  end
116
113
 
117
114
  # @api private
118
115
 
119
- def net_http_start(address, &block)
120
- http_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
116
+ def available_assets
117
+ @available_assets ||= net_http_start('api.github.com') do |http|
118
+ json = http.get('/repos/seleniumhq/selenium/releases').body
119
+ all_assets = JSON.parse(json).map { |release| release['assets'] }.flatten
120
+ server_assets = all_assets.select { |asset| asset['name'].match(/selenium-server-(\d+\.\d+\.\d+)\.jar/) }
121
+ server_assets.each_with_object({}) { |asset, hash| hash[asset.delete('name')] = asset }
122
+ end
123
+ end
124
+
125
+ def net_http_start(address, &)
126
+ http_proxy = ENV.fetch('http_proxy', nil) || ENV.fetch('HTTP_PROXY', nil)
121
127
  if http_proxy
122
128
  http_proxy = "http://#{http_proxy}" unless http_proxy.start_with?('http://')
123
129
  uri = URI.parse(http_proxy)
124
130
 
125
- Net::HTTP.start(address, nil, uri.host, uri.port, &block)
131
+ Net::HTTP.start(address, nil, uri.host, uri.port, &)
126
132
  else
127
- Net::HTTP.start(address, use_ssl: true, &block)
133
+ Net::HTTP.start(address, use_ssl: true, &)
128
134
  end
129
135
  end
130
136
 
@@ -160,7 +166,7 @@ module Selenium
160
166
  # :standalone, #hub, #node
161
167
  #
162
168
 
163
- attr_accessor :role, :port, :timeout, :background, :log
169
+ attr_accessor :role, :host, :port, :timeout, :background, :log
164
170
 
165
171
  #
166
172
  # @param [String] jar Path to the server jar.
@@ -177,15 +183,22 @@ module Selenium
177
183
  def initialize(jar, opts = {})
178
184
  raise Errno::ENOENT, jar unless File.exist?(jar)
179
185
 
180
- @jar = jar
181
- @host = '127.0.0.1'
182
- @role = opts.fetch(:role, 'standalone')
183
- @port = opts.fetch(:port, 4444)
184
- @timeout = opts.fetch(:timeout, 30)
186
+ @java = opts.fetch(:java, 'java')
187
+ @jar = jar
188
+ @host = '127.0.0.1'
189
+ @role = opts.fetch(:role, 'standalone')
190
+ @port = opts.fetch(:port, WebDriver::PortProber.above(4444))
191
+ @timeout = opts.fetch(:timeout, 30)
185
192
  @background = opts.fetch(:background, false)
186
- @log = opts[:log]
187
- @log_file = nil
188
- @additional_args = []
193
+ @additional_args = opts.fetch(:args, [])
194
+ @log = opts[:log]
195
+ if opts[:log_level]
196
+ @log ||= true
197
+ @additional_args << '--log-level'
198
+ @additional_args << opts[:log_level].to_s
199
+ end
200
+
201
+ @log_file = nil
189
202
  end
190
203
 
191
204
  def start
@@ -196,11 +209,6 @@ module Selenium
196
209
  end
197
210
 
198
211
  def stop
199
- begin
200
- Net::HTTP.get(@host, '/selenium-server/driver/?cmd=shutDownSeleniumServer', @port)
201
- rescue Errno::ECONNREFUSED
202
- end
203
-
204
212
  stop_process if @process
205
213
  poll_for_shutdown
206
214
 
@@ -222,13 +230,7 @@ module Selenium
222
230
  private
223
231
 
224
232
  def stop_process
225
- return unless @process.alive?
226
-
227
- begin
228
- @process.poll_for_exit(5)
229
- rescue ChildProcess::TimeoutError
230
- @process.stop
231
- end
233
+ @process.stop
232
234
  rescue Errno::ECHILD
233
235
  # already dead
234
236
  ensure
@@ -240,17 +242,13 @@ module Selenium
240
242
  # extract any additional_args that start with -D as options
241
243
  properties = @additional_args.dup - @additional_args.delete_if { |arg| arg[/^-D/] }
242
244
  args = ['-jar', @jar, @role, '--port', @port.to_s]
243
- server_command = ['java'] + properties + args + @additional_args
244
- cp = ChildProcess.build(*server_command)
245
- WebDriver.logger.debug("Executing Process #{server_command}")
246
-
247
- io = cp.io
245
+ server_command = [@java] + properties + args + @additional_args
246
+ cp = WebDriver::ChildProcess.build(*server_command)
248
247
 
249
248
  if @log.is_a?(String)
250
- @log_file = File.open(@log, 'w')
251
- io.stdout = io.stderr = @log_file
249
+ cp.io = @log
252
250
  elsif @log
253
- io.inherit!
251
+ cp.io = :out
254
252
  end
255
253
 
256
254
  cp.detach = @background