selenium-webdriver 4.2.0 → 4.4.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.
- package/CHANGES.md +154 -137
- package/chrome.js +10 -36
- package/chromium.js +4 -2
- package/devtools/CDPConnection.js +1 -1
- package/edge.js +8 -32
- package/firefox.js +1 -1
- package/ie.js +3 -3
- package/index.js +1 -1
- package/lib/command.js +9 -0
- package/lib/http.js +40 -0
- package/lib/input.js +76 -23
- package/lib/virtual_authenticator.js +230 -0
- package/lib/webdriver.js +120 -11
- package/net/index.js +9 -2
- package/package.json +10 -10
- package/testing/index.js +17 -19
package/CHANGES.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## v4.4.0
|
|
2
|
+
* Add support CDP 104 and remove CDP 101
|
|
3
|
+
|
|
4
|
+
## v4.3.1
|
|
5
|
+
|
|
6
|
+
* create new default service for every driver instance in chromium (#10796)
|
|
7
|
+
* Updated jsdoc for move action (#10816)
|
|
8
|
+
|
|
9
|
+
## v4.3.0
|
|
10
|
+
|
|
11
|
+
* Fix: using fulfillRequest when intercepting (#10764)
|
|
12
|
+
* Add support CDP 103 and remove CDP 100
|
|
13
|
+
* Remove unused param in input.js & minor code cleanup
|
|
14
|
+
* Fixes lint issues and updates npm packages
|
|
15
|
+
* feat: Added virtual authenticator (#10663)
|
|
16
|
+
|
|
1
17
|
## v4.2.0
|
|
2
18
|
|
|
3
19
|
* Delete old android-driver
|
|
@@ -84,7 +100,7 @@
|
|
|
84
100
|
ServiceBuilder, similarly to the other options provided by ChromeDriver.
|
|
85
101
|
|
|
86
102
|
* Add the debuggerAddress option to chromium.js (#9561) [Author: Brandon Walderman]
|
|
87
|
-
* Adds http client options
|
|
103
|
+
* Adds http client options [#9638](Author: Dharin Shah)
|
|
88
104
|
* Updating edge.js to extend chromium.driver (fixes #9626)
|
|
89
105
|
|
|
90
106
|
## v4.0.0-beta.4
|
|
@@ -116,7 +132,7 @@
|
|
|
116
132
|
## v4.0.0-beta.1
|
|
117
133
|
|
|
118
134
|
* JS Binding support for WebDriver Bidi in Firefox
|
|
119
|
-
|
|
135
|
+
* This requires Firefox 87 and Geckodriver 0.29 to be able to work
|
|
120
136
|
* Update the supported CDP versions
|
|
121
137
|
* Update tmp package version (#9155)
|
|
122
138
|
* Adding support for /computedlabel (getAccessibleName) (#9073)
|
|
@@ -130,11 +146,11 @@
|
|
|
130
146
|
|
|
131
147
|
* Rolling back native support for Opera Browser
|
|
132
148
|
* Added new ieOptions capabilities:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
149
|
+
* fileUploadDialogTimeout
|
|
150
|
+
* setEdgePath
|
|
151
|
+
* setEdgeChromium
|
|
152
|
+
* setScrollBehavior
|
|
153
|
+
* For consistent naming, deprecating `addArguments(...args)` in favor of `addBrowserCommandSwitches(...args)`
|
|
138
154
|
|
|
139
155
|
* Added relative locators
|
|
140
156
|
* Added Chrome DevTools Protocol (CDP) support
|
|
@@ -207,11 +223,11 @@ mode (see `example/headless.js`)
|
|
|
207
223
|
### API Changes
|
|
208
224
|
|
|
209
225
|
* The core WebDriver API no longer uses promise manager
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
226
|
+
* Removed `index.Builder#setControlFlow()`
|
|
227
|
+
* The following thenable types no longer have a `cancel()` method:
|
|
228
|
+
* The dynamically generated thenable WebDrivers created by `index.Builder`
|
|
229
|
+
* `lib/webdriver.AlertPromise`
|
|
230
|
+
* `lib/webdriver.WebElementPromise`
|
|
215
231
|
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead)
|
|
216
232
|
* Removed the `lib/actions` module
|
|
217
233
|
* Removed the `lib/events` module
|
|
@@ -219,123 +235,123 @@ mode (see `example/headless.js`)
|
|
|
219
235
|
* Removed the 'opera' module
|
|
220
236
|
* Removed the promise manager from `lib/promise`, which includes the removal of the following
|
|
221
237
|
exported names (replacements, if any, in parentheses):
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
* CancellableThenable
|
|
239
|
+
* CancellationError
|
|
240
|
+
* ControlFlow
|
|
241
|
+
* Deferred
|
|
242
|
+
* LONG_STACK_TRACES
|
|
243
|
+
* MultipleUnhandledRejectionError
|
|
244
|
+
* Promise (use native Promises)
|
|
245
|
+
* Resolver
|
|
246
|
+
* Scheduler
|
|
247
|
+
* Thenable
|
|
248
|
+
* USE_PROMISE_MANAGER
|
|
249
|
+
* all (use Promise.all)
|
|
250
|
+
* asap (use Promise.resolve)
|
|
251
|
+
* captureStackTrace (use Error.captureStackTrace)
|
|
252
|
+
* consume (use async functions)
|
|
253
|
+
* controlFlow
|
|
254
|
+
* createPromise (use new Promise)
|
|
255
|
+
* defer
|
|
256
|
+
* fulfilled (use Promise.resolve)
|
|
257
|
+
* isGenerator
|
|
258
|
+
* rejected (use Promise.reject)
|
|
259
|
+
* setDefaultFlow
|
|
260
|
+
* when (use Promise.resolve)
|
|
245
261
|
* Changes to the `Builder` class:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
262
|
+
* Added setChromeService, setEdgeService, & setFirefoxService
|
|
263
|
+
* Removed setEnableNativeEvents
|
|
264
|
+
* Removed setScrollBehavior
|
|
249
265
|
* Changes to `chrome.Driver`
|
|
250
|
-
|
|
251
|
-
|
|
266
|
+
* Added sendDevToolsCommand
|
|
267
|
+
* Added setDownloadPath
|
|
252
268
|
* Changes to `chrome.Options`
|
|
253
|
-
|
|
254
|
-
|
|
269
|
+
* Now extends the `Capabilities` class
|
|
270
|
+
* Removed from/toCapabilities
|
|
255
271
|
* Changes to `edge.Options`
|
|
256
|
-
|
|
257
|
-
|
|
272
|
+
* Now extends the `Capabilities` class
|
|
273
|
+
* Removed from/toCapabilities
|
|
258
274
|
* Changes to `ie.Options`
|
|
259
|
-
|
|
260
|
-
|
|
275
|
+
* Now extends the `Capabilities` class
|
|
276
|
+
* Removed from/toCapabilities
|
|
261
277
|
* Removed the `firefox.Binary` class. Custom binaries can still be selected using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be specified
|
|
262
278
|
with `firefox.Options#addArguments()`.
|
|
263
279
|
* Changes to `firefox.Driver`
|
|
264
|
-
|
|
265
|
-
|
|
280
|
+
* Added installAddon(path)
|
|
281
|
+
* Added uninstallAddon(id)
|
|
266
282
|
* Changes to `firefox.Options`
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
283
|
+
* Now extends the `Capabilities` class
|
|
284
|
+
* Removed from/toCapabilities
|
|
285
|
+
* Removed setLoggingPreferences (was a no-op)
|
|
286
|
+
* setProfile now only accepts a path to an existing profile
|
|
287
|
+
* Added addExtensions
|
|
288
|
+
* Added setPreference
|
|
273
289
|
* Removed the `firefox.Profile` class. All of its functionality is now provided directly by `firefox.Options`
|
|
274
290
|
* Removed the `firefox/binary` module
|
|
275
291
|
* Removed the `firefox/profile` module
|
|
276
292
|
* Changes to `safari.Options`
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
293
|
+
* Now extends the `Capabilities` class
|
|
294
|
+
* Removed from/toCapabilities
|
|
295
|
+
* Removed setCleanSession (was a no-op)
|
|
280
296
|
* Changes to `lib/capabilities.Browser`:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
297
|
+
* Removed several enum values.
|
|
298
|
+
* ANDROID (use Chrome for Android; see docs on the chrome module)
|
|
299
|
+
* IPAD (no support available)
|
|
300
|
+
* IPHONE (no support available)
|
|
301
|
+
* OPERA (use Chrome)
|
|
302
|
+
* PHANTOM_JS (use Chrome or Firefox in headless mode)
|
|
303
|
+
* HTMLUNIT (use Chrome or Firefox in headless mode)
|
|
288
304
|
* Changes to `lib/capabilities.Capabilities`:
|
|
289
|
-
|
|
305
|
+
* Removed static factory methods android(), ipad(), iphone(), opera(), phantomjs(), htmlunit(),
|
|
290
306
|
and htmlunitwithjs(). Users can still manually configure capabilities for these, but their use
|
|
291
307
|
is not recommended and they will no longer be surfaced in the API.
|
|
292
308
|
* Changes to `lib/error`:
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
309
|
+
* Added
|
|
310
|
+
* ElementClickInterceptedError
|
|
311
|
+
* InsecureCertificateError
|
|
312
|
+
* InvalidCoordinatesError
|
|
313
|
+
* NoSuchCookieError
|
|
314
|
+
* Removed
|
|
315
|
+
* ElementNotVisibleError
|
|
316
|
+
* InvalidElementCoordinatesError
|
|
301
317
|
* Changes to `lib/webdriver.WebDriver`:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
318
|
+
* Dropped support for "requiredCapabilities" from WebDriver.createSession
|
|
319
|
+
* actions() now returns the new `lib/input.Actions` class
|
|
320
|
+
* Removed touchActions
|
|
321
|
+
* Renamed schedule to execute
|
|
322
|
+
* Removed the `WebDriver.attachToSession()` factory method. Users can just the `WebDriver`
|
|
307
323
|
constructor directly instead.
|
|
308
|
-
|
|
324
|
+
* Removed the `call()` method. This was used to inject custom function calls into the control
|
|
309
325
|
flow. Now that the promise manager is no longer used, this method is no longer necessary. Users are now responsible for coordinating actions (ideally with async functions) and can just
|
|
310
326
|
call functions directly instead of through `driver.call()`.
|
|
311
327
|
* Changes to `lib/webdriver.WebElement`:
|
|
312
|
-
|
|
328
|
+
* Replaced getSize & getLocation with getRect
|
|
313
329
|
* Changes to `lib/webdriver.Alert`:
|
|
314
|
-
|
|
330
|
+
* Removed authenticateAs
|
|
315
331
|
* Changes to `lib/webdriver.Options` (`driver.manage()`):
|
|
316
|
-
|
|
332
|
+
* Removed timeouts (use get/setTimeouts)
|
|
317
333
|
* Changes to `lib/webdriver.Window` (`driver.manage().window()`):
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
* Added
|
|
335
|
+
* getRect
|
|
336
|
+
* setRect
|
|
337
|
+
* fullscreen
|
|
338
|
+
* minimize
|
|
339
|
+
* Removed (use the getRect/setRect methods)
|
|
340
|
+
* getPosition
|
|
341
|
+
* setPosition
|
|
342
|
+
* getSize
|
|
343
|
+
* setSize
|
|
328
344
|
* Removed the `testing/assert` module
|
|
329
345
|
* Changes to `testing/index`
|
|
330
|
-
|
|
346
|
+
* Since the promise manager has been removed, it is no longer necessary to wrap the Mocha test
|
|
331
347
|
hooks; instead, users can simply use async functions. The following have all been removed:
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
348
|
+
* describe
|
|
349
|
+
* before
|
|
350
|
+
* beforeEach
|
|
351
|
+
* after
|
|
352
|
+
* afterEach
|
|
353
|
+
* it
|
|
354
|
+
* Added the `suite` function. For details, refer to the jsdoc or
|
|
339
355
|
`example/google_search_test.js`
|
|
340
356
|
|
|
341
357
|
## v3.6.0
|
|
@@ -352,18 +368,18 @@ mode (see `example/headless.js`)
|
|
|
352
368
|
### API Changes
|
|
353
369
|
|
|
354
370
|
* Added new methods to `selenium-webdriver/firefox.Options`:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
371
|
+
* addArguments()
|
|
372
|
+
* headless()
|
|
373
|
+
* windowSize()
|
|
358
374
|
* Deprecated `selenium-webdriver/firefox/binary.Binary`
|
|
359
375
|
* Removed `selenium-webdriver/firefox.Options#useGeckoDriver()`
|
|
360
376
|
* Removed the unused `selenium-webdriver/firefox/profile.decode()`
|
|
361
377
|
* Removed methods from `selenium-webdriver/firefox/profile.Profile` that had no effect since support
|
|
362
378
|
for the legacy FirefoxDriver was dropped in 3.5.0:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
379
|
+
* setNativeEventsEnabled
|
|
380
|
+
* nativeEventsEnabled
|
|
381
|
+
* getPort
|
|
382
|
+
* setPort
|
|
367
383
|
* Removed `selenium-webdriver/firefox.ServiceBuilder#setFirefoxBinary()`; custom binaries should be
|
|
368
384
|
configured through the `firefox.Options` class.
|
|
369
385
|
* Removed `selenium-webdriver/firefox.Capability`. These hold overs from the legacy FirefoxDriver
|
|
@@ -385,9 +401,9 @@ to a remote Selenium server that supports Firefox 45.
|
|
|
385
401
|
### Changes
|
|
386
402
|
|
|
387
403
|
* Removed native support for Firefox 46 and older.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
404
|
+
* The `SELENIUM_MARIONETTE` enviornment variable no longer has an effect.
|
|
405
|
+
* `selenium-webdriver/firefox.Capability.MARIONETTE` is deprecated.
|
|
406
|
+
* `selenium-webdriver/firefox.Options#useGeckoDriver()` is deprecated and now a no-op.
|
|
391
407
|
* `firefox.Options` will no longer discard the `"moz:firefoxOptions"` set in user provided
|
|
392
408
|
capabilities (via `Builder.withCapabilities({})`). When both are used, the settings in `firefox.Options` will be applied _last_.
|
|
393
409
|
* Added `chrome.Options#headless()` and `chrome.Options#windowSize()`, which may be used to start
|
|
@@ -432,6 +448,7 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
432
448
|
logging.installConsoleHandler();
|
|
433
449
|
logging.getLogger('promise.ControlFlow').setLevel(logging.Level.WARNING);
|
|
434
450
|
```
|
|
451
|
+
|
|
435
452
|
* If the `JAVA_HOME` environment variable is set, use it to locate java.exe.
|
|
436
453
|
|
|
437
454
|
## v3.2.0
|
|
@@ -458,8 +475,8 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
458
475
|
## v3.0.1
|
|
459
476
|
|
|
460
477
|
* More API adjustments to align with native Promises
|
|
461
|
-
|
|
462
|
-
|
|
478
|
+
* Deprecated `promise.fulfilled(value)`, use `promise.Promise#resolve(value)`
|
|
479
|
+
* Deprecated `promise.rejected(reason)`, use `promise.Promise#reject(reason)`
|
|
463
480
|
* When a `wait()` condition times out, the returned promise will now be rejected with an `error.TimeoutError` instead of a generic `Error` object.
|
|
464
481
|
* `WebDriver#wait()` will now throw a TypeError if an invalid wait condition is provided.
|
|
465
482
|
* Properly catch unhandled promise rejections with an action sequence (only impacts when the promise
|
|
@@ -494,9 +511,9 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
494
511
|
|
|
495
512
|
* Removed `safari.Options#useLegacyDriver()`
|
|
496
513
|
* Reduced the API on `promise.Thenable` for compatibility with native promises:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
514
|
+
* Removed `#isPending()`
|
|
515
|
+
* Removed `#cancel()`
|
|
516
|
+
* Removed `#finally()`
|
|
500
517
|
* Changed all subclasses of `webdriver.WebDriver` to overload the static function `WebDriver.createSession()` instead of doing work in the constructor. All constructors
|
|
501
518
|
now inherit the base class' function signature. Users are still encouraged to use the `Builder`
|
|
502
519
|
class instead of creating drivers directly.
|
|
@@ -575,32 +592,32 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
575
592
|
_seconds_ since epoch. When retrieving cookies, the expiration is always returned in seconds.
|
|
576
593
|
* Renamed `firefox.Options#useMarionette` to `firefox.Options#useGeckoDriver`
|
|
577
594
|
* Removed deprecated modules:
|
|
578
|
-
|
|
595
|
+
* `selenium-webdriver/error` (use `selenium-webdriver/lib/error`,\
|
|
579
596
|
or the `error` property exported by `selenium-webdriver`)
|
|
580
|
-
|
|
597
|
+
* `selenium-webdriver/executors` — this was not previously deprecated, but is no longer used.
|
|
581
598
|
* Removed deprecated types:
|
|
582
|
-
|
|
599
|
+
* `command.DeferredExecutor` — this was not previously deprecated, but is no longer used. It can
|
|
583
600
|
be trivially implemented by clients should it be needed.
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
601
|
+
* `error.InvalidSessionIdError` (use `error.NoSuchSessionError`)
|
|
602
|
+
* `executors.DeferredExecutor`
|
|
603
|
+
* `until.Condition` (use `webdriver.Condition`)
|
|
604
|
+
* `until.WebElementCondition` (use `webdriver.WebElementCondition`)
|
|
605
|
+
* `webdriver.UnhandledAlertError` (use `error.UnexpectedAlertOpenError`)
|
|
589
606
|
* Removed deprecated functions:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
607
|
+
* `Deferred#cancel()`
|
|
608
|
+
* `Deferred#catch()`
|
|
609
|
+
* `Deferred#finally()`
|
|
610
|
+
* `Deferred#isPending()`
|
|
611
|
+
* `Deferred#then()`
|
|
612
|
+
* `Promise#thenCatch()`
|
|
613
|
+
* `Promise#thenFinally()`
|
|
614
|
+
* `WebDriver#isElementPresent()`
|
|
615
|
+
* `WebElement#getInnerHtml()`
|
|
616
|
+
* `WebElement#getOuterHtml()`
|
|
617
|
+
* `WebElement#getRawId()`
|
|
618
|
+
* `WebElement#isElementPresent()`
|
|
602
619
|
* Removed deprecated properties:
|
|
603
|
-
|
|
620
|
+
* `WebDriverError#code`
|
|
604
621
|
|
|
605
622
|
## v2.53.2
|
|
606
623
|
|
|
@@ -841,7 +858,7 @@ major version release (i.e. 1.0.0).
|
|
|
841
858
|
The `promise.ControlFlow` class has been updated to track the asynchronous breaks required by
|
|
842
859
|
Promises/A+, so there are no changes to task execution order.
|
|
843
860
|
* Updated how errors are annotated on failures. When a task fails, the stacktrace from when that
|
|
844
|
-
task was scheduled is appended to the rejection reason with a `From
|
|
861
|
+
task was scheduled is appended to the rejection reason with a `From:` prefix (if it is an Error
|
|
845
862
|
object). For example:
|
|
846
863
|
|
|
847
864
|
var driver = new webdriver.Builder().forBrowser('chrome').build();
|
package/chrome.js
CHANGED
|
@@ -140,7 +140,6 @@ const CHROMEDRIVER_EXE =
|
|
|
140
140
|
process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'
|
|
141
141
|
|
|
142
142
|
/** @type {remote.DriverService} */
|
|
143
|
-
let defaultService = null
|
|
144
143
|
|
|
145
144
|
/**
|
|
146
145
|
* Creates {@link selenium-webdriver/remote.DriverService} instances that manage
|
|
@@ -240,6 +239,14 @@ class Driver extends chromium.Driver {
|
|
|
240
239
|
super.createSession(caps, opt_serviceExecutor)
|
|
241
240
|
)
|
|
242
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* returns new instance chrome driver service
|
|
245
|
+
* @returns {remote.DriverService}
|
|
246
|
+
*/
|
|
247
|
+
static getDefaultService() {
|
|
248
|
+
return new ServiceBuilder().build()
|
|
249
|
+
}
|
|
243
250
|
}
|
|
244
251
|
|
|
245
252
|
/**
|
|
@@ -252,47 +259,14 @@ function locateSynchronously() {
|
|
|
252
259
|
return io.findInPath(CHROMEDRIVER_EXE, true)
|
|
253
260
|
}
|
|
254
261
|
|
|
255
|
-
/**
|
|
256
|
-
* Sets the default service to use for new ChromeDriver instances.
|
|
257
|
-
* @param {!remote.DriverService} service The service to use.
|
|
258
|
-
* @throws {Error} If the default service is currently running.
|
|
259
|
-
*/
|
|
260
|
-
function setDefaultService(service) {
|
|
261
|
-
if (defaultService && defaultService.isRunning()) {
|
|
262
|
-
throw Error(
|
|
263
|
-
`The previously configured ChromeDriver service is still running. ` +
|
|
264
|
-
`You must shut it down before you may adjust its configuration.`
|
|
265
|
-
)
|
|
266
|
-
}
|
|
267
|
-
defaultService = service
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Returns the default ChromeDriver service. If such a service has not been
|
|
272
|
-
* configured, one will be constructed using the default configuration for
|
|
273
|
-
* a ChromeDriver executable found on the system PATH.
|
|
274
|
-
* @return {!remote.DriverService} The default ChromeDriver service.
|
|
275
|
-
*/
|
|
276
|
-
function getDefaultService() {
|
|
277
|
-
if (!defaultService) {
|
|
278
|
-
defaultService = new ServiceBuilder().build()
|
|
279
|
-
}
|
|
280
|
-
return defaultService
|
|
281
|
-
}
|
|
282
|
-
|
|
283
262
|
Options.prototype.CAPABILITY_KEY = 'goog:chromeOptions'
|
|
284
263
|
Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME
|
|
285
|
-
Driver.getDefaultService = getDefaultService
|
|
286
264
|
Driver.prototype.VENDOR_COMMAND_PREFIX = 'goog'
|
|
287
265
|
|
|
288
266
|
// PUBLIC API
|
|
289
|
-
|
|
290
267
|
module.exports = {
|
|
291
268
|
Driver: Driver,
|
|
292
269
|
Options,
|
|
293
|
-
ServiceBuilder
|
|
294
|
-
|
|
295
|
-
setDefaultService,
|
|
296
|
-
locateSynchronously
|
|
270
|
+
ServiceBuilder,
|
|
271
|
+
locateSynchronously,
|
|
297
272
|
}
|
|
298
|
-
|
package/chromium.js
CHANGED
|
@@ -661,11 +661,13 @@ class Driver extends webdriver.WebDriver {
|
|
|
661
661
|
*/
|
|
662
662
|
static createSession(caps, opt_serviceExecutor) {
|
|
663
663
|
let executor
|
|
664
|
+
let onQuit
|
|
664
665
|
if (opt_serviceExecutor instanceof http.Executor) {
|
|
665
666
|
executor = opt_serviceExecutor
|
|
666
667
|
configureExecutor(executor, this.VENDOR_COMMAND_PREFIX)
|
|
667
668
|
} else {
|
|
668
669
|
let service = opt_serviceExecutor || this.getDefaultService()
|
|
670
|
+
onQuit = () => service.kill()
|
|
669
671
|
executor = createExecutor(service.start(), this.VENDOR_COMMAND_PREFIX)
|
|
670
672
|
}
|
|
671
673
|
|
|
@@ -679,7 +681,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
679
681
|
}
|
|
680
682
|
}
|
|
681
683
|
|
|
682
|
-
return /** @type {!Driver} */ (super.createSession(executor, caps))
|
|
684
|
+
return /** @type {!Driver} */ (super.createSession(executor, caps, onQuit))
|
|
683
685
|
}
|
|
684
686
|
|
|
685
687
|
/**
|
|
@@ -860,7 +862,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
860
862
|
* @return {!promise.Thenable<void>} A promise that will be resolved
|
|
861
863
|
* when the mirror command has been issued to the device.
|
|
862
864
|
*/
|
|
863
|
-
|
|
865
|
+
startDesktopMirroring(deviceName) {
|
|
864
866
|
return this.schedule(
|
|
865
867
|
new command.Command(Command.START_CAST_DESKTOP_MIRRORING).setParameter(
|
|
866
868
|
'sinkName',
|
package/edge.js
CHANGED
|
@@ -90,7 +90,6 @@ const EDGEDRIVER_CHROMIUM_EXE =
|
|
|
90
90
|
process.platform === 'win32' ? 'msedgedriver.exe' : 'msedgedriver'
|
|
91
91
|
|
|
92
92
|
/** @type {remote.DriverService} */
|
|
93
|
-
let defaultService = null
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
95
|
* Creates {@link selenium-webdriver/remote.DriverService} instances that manage
|
|
@@ -157,6 +156,14 @@ class Driver extends chromium.Driver {
|
|
|
157
156
|
)
|
|
158
157
|
}
|
|
159
158
|
|
|
159
|
+
/**
|
|
160
|
+
* returns new instance of edge driver service
|
|
161
|
+
* @returns {remote.DriverService}
|
|
162
|
+
*/
|
|
163
|
+
static getDefaultService() {
|
|
164
|
+
return new ServiceBuilder().build()
|
|
165
|
+
}
|
|
166
|
+
|
|
160
167
|
/**
|
|
161
168
|
* This function is a no-op as file detectors are not supported by this
|
|
162
169
|
* implementation.
|
|
@@ -165,34 +172,6 @@ class Driver extends chromium.Driver {
|
|
|
165
172
|
setFileDetector() {}
|
|
166
173
|
}
|
|
167
174
|
|
|
168
|
-
/**
|
|
169
|
-
* Sets the default service to use for new Edge instances.
|
|
170
|
-
* @param {!remote.DriverService} service The service to use.
|
|
171
|
-
* @throws {Error} If the default service is currently running.
|
|
172
|
-
*/
|
|
173
|
-
function setDefaultService(service) {
|
|
174
|
-
if (defaultService && defaultService.isRunning()) {
|
|
175
|
-
throw Error(
|
|
176
|
-
'The previously configured EdgeDriver service is still running. ' +
|
|
177
|
-
'You must shut it down before you may adjust its configuration.'
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
defaultService = service
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Returns the default Microsoft Edge driver service. If such a service has
|
|
185
|
-
* not been configured, one will be constructed using the default configuration
|
|
186
|
-
* for a MicrosoftWebDriver executable found on the system PATH.
|
|
187
|
-
* @return {!remote.DriverService} The default Microsoft Edge driver service.
|
|
188
|
-
*/
|
|
189
|
-
function getDefaultService() {
|
|
190
|
-
if (!defaultService) {
|
|
191
|
-
defaultService = new ServiceBuilder().build()
|
|
192
|
-
}
|
|
193
|
-
return defaultService
|
|
194
|
-
}
|
|
195
|
-
|
|
196
175
|
/**
|
|
197
176
|
* _Synchronously_ attempts to locate the chromedriver executable on the current
|
|
198
177
|
* system.
|
|
@@ -206,7 +185,6 @@ function locateSynchronously() {
|
|
|
206
185
|
Options.prototype.BROWSER_NAME_VALUE = Browser.EDGE
|
|
207
186
|
Options.prototype.CAPABILITY_KEY = 'ms:edgeOptions'
|
|
208
187
|
Driver.prototype.VENDOR_CAPABILITY_PREFIX = 'ms'
|
|
209
|
-
Driver.getDefaultService = getDefaultService
|
|
210
188
|
|
|
211
189
|
// PUBLIC API
|
|
212
190
|
|
|
@@ -214,7 +192,5 @@ module.exports = {
|
|
|
214
192
|
Driver,
|
|
215
193
|
Options,
|
|
216
194
|
ServiceBuilder,
|
|
217
|
-
getDefaultService,
|
|
218
|
-
setDefaultService,
|
|
219
195
|
locateSynchronously,
|
|
220
196
|
}
|
package/firefox.js
CHANGED
package/ie.js
CHANGED
|
@@ -402,9 +402,9 @@ function createServiceFromCapabilities(capabilities) {
|
|
|
402
402
|
if (!exe || !fs.existsSync(exe)) {
|
|
403
403
|
throw Error(
|
|
404
404
|
`${IEDRIVER_EXE} could not be found on the current PATH. Please ` +
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
`download the latest version of ${IEDRIVER_EXE} from ` +
|
|
406
|
+
'https://www.selenium.dev/downloads/ and ' +
|
|
407
|
+
'ensure it can be found on your system PATH.'
|
|
408
408
|
)
|
|
409
409
|
}
|
|
410
410
|
|
package/index.js
CHANGED
|
@@ -77,7 +77,7 @@ function startSeleniumServer(jar) {
|
|
|
77
77
|
function ensureFileDetectorsAreEnabled(ctor) {
|
|
78
78
|
return class extends ctor {
|
|
79
79
|
/** @param {input.FileDetector} detector */
|
|
80
|
-
setFileDetector
|
|
80
|
+
setFileDetector(detector) {
|
|
81
81
|
webdriver.WebDriver.prototype.setFileDetector.call(this, detector)
|
|
82
82
|
}
|
|
83
83
|
}
|
package/lib/command.js
CHANGED
|
@@ -164,6 +164,15 @@ const Name = {
|
|
|
164
164
|
FIND_ELEMENT_FROM_SHADOWROOT: 'findElementFromShadowRoot',
|
|
165
165
|
FIND_ELEMENTS_FROM_SHADOWROOT: 'findElementsFromShadowRoot',
|
|
166
166
|
|
|
167
|
+
// Virtual Authenticator Commands
|
|
168
|
+
ADD_VIRTUAL_AUTHENTICATOR: 'addVirtualAuthenticator',
|
|
169
|
+
REMOVE_VIRTUAL_AUTHENTICATOR: 'removeVirtualAuthenticator',
|
|
170
|
+
ADD_CREDENTIAL: 'addCredential',
|
|
171
|
+
GET_CREDENTIALS: 'getCredentials',
|
|
172
|
+
REMOVE_CREDENTIAL: 'removeCredential',
|
|
173
|
+
REMOVE_ALL_CREDENTIALS: 'removeAllCredentials',
|
|
174
|
+
SET_USER_VERIFIED: 'setUserVerified',
|
|
175
|
+
|
|
167
176
|
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes',
|
|
168
177
|
GET_LOG: 'getLog',
|
|
169
178
|
|