selenium-webdriver 3.3.0 → 4.0.0-alpha.1
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 +273 -0
- package/NOTICE +1 -1
- package/README.md +28 -36
- package/chrome.js +221 -146
- package/edge.js +43 -118
- package/example/chrome_android.js +8 -9
- package/example/chrome_mobile_emulation.js +9 -10
- package/example/firefox_channels.js +23 -19
- package/example/google_search.js +3 -3
- package/example/google_search_test.js +39 -27
- package/example/headless.js +55 -0
- package/example/logging.js +40 -7
- package/firefox.js +769 -0
- package/http/index.js +41 -4
- package/http/util.js +11 -6
- package/ie.js +57 -98
- package/index.js +182 -115
- package/io/index.js +59 -0
- package/io/zip.js +214 -0
- package/jasmine.json +11 -0
- package/lib/actions.js +68 -63
- package/lib/atoms/get-attribute.js +9 -0
- package/lib/atoms/is-displayed.js +73 -78
- package/lib/by.js +9 -1
- package/lib/capabilities.js +303 -201
- package/lib/command.js +28 -50
- package/lib/error.js +113 -42
- package/lib/http.js +167 -135
- package/lib/input.js +1044 -8
- package/lib/promise.js +222 -3331
- package/lib/proxy.js +134 -39
- package/lib/test/bootstrap_jasmine.js +28 -0
- package/lib/test/data/actions/click.html +24 -0
- package/lib/test/data/actions/drag.html +77 -0
- package/lib/test/data/actions/record_click.html +21 -0
- package/lib/test/data/chrome/download.html +2 -0
- package/lib/test/data/click_tests/disabled_element.html +12 -0
- package/lib/test/data/content-editable.html +10 -0
- package/lib/test/data/firefox/webextension.xpi +0 -0
- package/lib/test/data/inputs.html +42 -0
- package/lib/test/data/key_logger.html +34 -0
- package/lib/test/data/nestedElements.html +10 -1
- package/lib/test/data/scrolling_tests/page_with_partially_hidden_element.html +14 -0
- package/lib/test/data/selectPage.html +12 -0
- package/lib/test/data/simpleTest.html +5 -0
- package/lib/test/data/single_text_input.html +12 -0
- package/lib/test/data/upload_invisible.html +45 -0
- package/lib/test/fileserver.js +23 -19
- package/lib/test/index.js +30 -244
- package/lib/test/resources.js +0 -1
- package/lib/webdriver.js +770 -939
- package/net/index.js +21 -25
- package/net/portprober.js +51 -68
- package/package.json +6 -4
- package/remote/index.js +18 -30
- package/safari.js +42 -129
- package/test/actions_test.js +173 -18
- package/test/builder_test.js +106 -0
- package/test/chrome/devtools_test.js +93 -0
- package/test/chrome/options_test.js +48 -154
- package/test/chrome/service_test.js +7 -7
- package/test/cookie_test.js +77 -63
- package/test/element_finding_test.js +206 -201
- package/test/execute_script_test.js +115 -114
- package/test/fingerprint_test.js +16 -15
- package/test/firefox_test.js +251 -0
- package/test/http/http_test.js +18 -1
- package/test/http/util_test.js +2 -2
- package/test/{io_test.js → io/io_test.js} +40 -1
- package/test/io/zip_test.js +127 -0
- package/test/lib/by_test.js +21 -0
- package/test/lib/error_test.js +55 -8
- package/test/lib/http_test.js +18 -130
- package/test/lib/input_test.js +1379 -0
- package/test/lib/promise_test.js +473 -908
- package/test/lib/webdriver_test.js +357 -825
- package/test/logging_test.js +37 -43
- package/test/page_loading_test.js +70 -86
- package/test/proxy_test.js +64 -72
- package/test/rect_test.js +14 -25
- package/test/remote_test.js +13 -32
- package/test/safari_test.js +7 -71
- package/test/stale_element_test.js +20 -23
- package/test/tag_name_test.js +10 -9
- package/test/upload_test.js +27 -35
- package/test/window_test.js +72 -85
- package/testing/index.js +386 -315
- package/.npmignore +0 -2
- package/example/async_await_test.js +0 -68
- package/example/google_search_generator.js +0 -50
- package/example/parallel_flows.js +0 -54
- package/firefox/binary.js +0 -344
- package/firefox/extension.js +0 -187
- package/firefox/index.js +0 -722
- package/firefox/profile.js +0 -430
- package/lib/atoms/getAttribute.js +0 -12
- package/lib/events.js +0 -210
- package/lib/firefox/webdriver.json +0 -70
- package/lib/firefox/webdriver.xpi +0 -0
- package/lib/test/data/firefox/jetpack-sample.xpi +0 -0
- package/lib/test/data/firefox/sample.xpi +0 -0
- package/lib/test/promise.js +0 -79
- package/opera.js +0 -405
- package/phantomjs.js +0 -282
- package/test/firefox/extension_test.js +0 -96
- package/test/firefox/firefox_test.js +0 -226
- package/test/firefox/profile_test.js +0 -185
- package/test/lib/events_test.js +0 -177
- package/test/lib/promise_aplus_test.js +0 -78
- package/test/lib/promise_error_test.js +0 -884
- package/test/lib/promise_flow_test.js +0 -2288
- package/test/lib/promise_generator_test.js +0 -310
- package/test/phantomjs/execute_phantomjs_test.js +0 -59
- package/test/session_test.js +0 -54
- package/test/testing/assert_test.js +0 -373
- package/test/testing/index_test.js +0 -224
- package/testing/assert.js +0 -378
package/lib/command.js
CHANGED
|
@@ -90,7 +90,6 @@ const Name = {
|
|
|
90
90
|
|
|
91
91
|
NEW_SESSION: 'newSession',
|
|
92
92
|
GET_SESSIONS: 'getSessions',
|
|
93
|
-
DESCRIBE_SESSION: 'getSessionCapabilities',
|
|
94
93
|
|
|
95
94
|
CLOSE: 'close',
|
|
96
95
|
QUIT: 'quit',
|
|
@@ -124,10 +123,15 @@ const Name = {
|
|
|
124
123
|
SET_WINDOW_POSITION: 'setWindowPosition',
|
|
125
124
|
GET_WINDOW_SIZE: 'getWindowSize',
|
|
126
125
|
SET_WINDOW_SIZE: 'setWindowSize',
|
|
126
|
+
GET_WINDOW_RECT: 'getWindowRect',
|
|
127
|
+
SET_WINDOW_RECT: 'setWindowRect',
|
|
127
128
|
MAXIMIZE_WINDOW: 'maximizeWindow',
|
|
129
|
+
MINIMIZE_WINDOW: 'minimizeWindow',
|
|
130
|
+
FULLSCREEN_WINDOW: 'fullscreenWindow',
|
|
128
131
|
|
|
129
132
|
SWITCH_TO_WINDOW: 'switchToWindow',
|
|
130
133
|
SWITCH_TO_FRAME: 'switchToFrame',
|
|
134
|
+
SWITCH_TO_FRAME_PARENT: 'switchToFrameParent',
|
|
131
135
|
GET_PAGE_SOURCE: 'getPageSource',
|
|
132
136
|
GET_TITLE: 'getTitle',
|
|
133
137
|
|
|
@@ -141,81 +145,55 @@ const Name = {
|
|
|
141
145
|
IS_ELEMENT_DISPLAYED: 'isElementDisplayed',
|
|
142
146
|
GET_ELEMENT_LOCATION: 'getElementLocation',
|
|
143
147
|
GET_ELEMENT_LOCATION_IN_VIEW: 'getElementLocationOnceScrolledIntoView',
|
|
148
|
+
GET_ELEMENT_RECT: 'getElementRect',
|
|
144
149
|
GET_ELEMENT_SIZE: 'getElementSize',
|
|
145
150
|
GET_ELEMENT_ATTRIBUTE: 'getElementAttribute',
|
|
146
151
|
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: 'getElementValueOfCssProperty',
|
|
147
|
-
ELEMENT_EQUALS: 'elementEquals',
|
|
148
152
|
|
|
149
153
|
SCREENSHOT: 'screenshot',
|
|
150
154
|
TAKE_ELEMENT_SCREENSHOT: 'takeElementScreenshot',
|
|
151
155
|
IMPLICITLY_WAIT: 'implicitlyWait',
|
|
152
156
|
SET_SCRIPT_TIMEOUT: 'setScriptTimeout',
|
|
157
|
+
|
|
158
|
+
GET_TIMEOUT: 'getTimeout',
|
|
153
159
|
SET_TIMEOUT: 'setTimeout',
|
|
154
160
|
|
|
155
161
|
ACCEPT_ALERT: 'acceptAlert',
|
|
156
162
|
DISMISS_ALERT: 'dismissAlert',
|
|
157
163
|
GET_ALERT_TEXT: 'getAlertText',
|
|
158
164
|
SET_ALERT_TEXT: 'setAlertValue',
|
|
159
|
-
SET_ALERT_CREDENTIALS: 'setAlertCredentials',
|
|
160
|
-
|
|
161
|
-
EXECUTE_SQL: 'executeSQL',
|
|
162
|
-
GET_LOCATION: 'getLocation',
|
|
163
|
-
SET_LOCATION: 'setLocation',
|
|
164
|
-
GET_APP_CACHE: 'getAppCache',
|
|
165
|
-
GET_APP_CACHE_STATUS: 'getStatus',
|
|
166
|
-
CLEAR_APP_CACHE: 'clearAppCache',
|
|
167
|
-
IS_BROWSER_ONLINE: 'isBrowserOnline',
|
|
168
|
-
SET_BROWSER_ONLINE: 'setBrowserOnline',
|
|
169
|
-
|
|
170
|
-
GET_LOCAL_STORAGE_ITEM: 'getLocalStorageItem',
|
|
171
|
-
GET_LOCAL_STORAGE_KEYS: 'getLocalStorageKeys',
|
|
172
|
-
SET_LOCAL_STORAGE_ITEM: 'setLocalStorageItem',
|
|
173
|
-
REMOVE_LOCAL_STORAGE_ITEM: 'removeLocalStorageItem',
|
|
174
|
-
CLEAR_LOCAL_STORAGE: 'clearLocalStorage',
|
|
175
|
-
GET_LOCAL_STORAGE_SIZE: 'getLocalStorageSize',
|
|
176
|
-
|
|
177
|
-
GET_SESSION_STORAGE_ITEM: 'getSessionStorageItem',
|
|
178
|
-
GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey',
|
|
179
|
-
SET_SESSION_STORAGE_ITEM: 'setSessionStorageItem',
|
|
180
|
-
REMOVE_SESSION_STORAGE_ITEM: 'removeSessionStorageItem',
|
|
181
|
-
CLEAR_SESSION_STORAGE: 'clearSessionStorage',
|
|
182
|
-
GET_SESSION_STORAGE_SIZE: 'getSessionStorageSize',
|
|
183
|
-
|
|
184
|
-
SET_SCREEN_ORIENTATION: 'setScreenOrientation',
|
|
185
|
-
GET_SCREEN_ORIENTATION: 'getScreenOrientation',
|
|
186
|
-
|
|
187
|
-
// These belong to the Advanced user interactions - an element is
|
|
188
|
-
// optional for these commands.
|
|
189
|
-
CLICK: 'mouseClick',
|
|
190
|
-
DOUBLE_CLICK: 'mouseDoubleClick',
|
|
191
|
-
MOUSE_DOWN: 'mouseButtonDown',
|
|
192
|
-
MOUSE_UP: 'mouseButtonUp',
|
|
193
|
-
MOVE_TO: 'mouseMoveTo',
|
|
194
|
-
SEND_KEYS_TO_ACTIVE_ELEMENT: 'sendKeysToActiveElement',
|
|
195
|
-
|
|
196
|
-
// These belong to the Advanced Touch API
|
|
197
|
-
TOUCH_SINGLE_TAP: 'touchSingleTap',
|
|
198
|
-
TOUCH_DOWN: 'touchDown',
|
|
199
|
-
TOUCH_UP: 'touchUp',
|
|
200
|
-
TOUCH_MOVE: 'touchMove',
|
|
201
|
-
TOUCH_SCROLL: 'touchScroll',
|
|
202
|
-
TOUCH_DOUBLE_TAP: 'touchDoubleTap',
|
|
203
|
-
TOUCH_LONG_PRESS: 'touchLongPress',
|
|
204
|
-
TOUCH_FLICK: 'touchFlick',
|
|
205
165
|
|
|
206
166
|
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes',
|
|
207
167
|
GET_LOG: 'getLog',
|
|
208
168
|
GET_SESSION_LOGS: 'getSessionLogs',
|
|
209
169
|
|
|
210
170
|
// Non-standard commands used by the standalone Selenium server.
|
|
211
|
-
UPLOAD_FILE: 'uploadFile'
|
|
171
|
+
UPLOAD_FILE: 'uploadFile',
|
|
172
|
+
|
|
173
|
+
ACTIONS: 'actions',
|
|
174
|
+
CLEAR_ACTIONS: 'clearActions',
|
|
175
|
+
|
|
176
|
+
LEGACY_ACTION_CLICK: 'legacyAction:click',
|
|
177
|
+
LEGACY_ACTION_DOUBLE_CLICK: 'legacyAction:doubleclick',
|
|
178
|
+
LEGACY_ACTION_MOUSE_DOWN: 'legacyAction:mouseDown',
|
|
179
|
+
LEGACY_ACTION_MOUSE_UP: 'legacyAction:mouseUp',
|
|
180
|
+
LEGACY_ACTION_MOUSE_MOVE: 'legacyAction:mouseMove',
|
|
181
|
+
LEGACY_ACTION_SEND_KEYS: 'legacyAction:sendKeys',
|
|
182
|
+
LEGACY_ACTION_TOUCH_DOWN: 'legacyAction:touchDown',
|
|
183
|
+
LEGACY_ACTION_TOUCH_UP: 'legacyAction:touchUp',
|
|
184
|
+
LEGACY_ACTION_TOUCH_MOVE: 'legacyAction:touchMove',
|
|
185
|
+
LEGACY_ACTION_TOUCH_SCROLL: 'legacyAction:touchScroll',
|
|
186
|
+
LEGACY_ACTION_TOUCH_LONG_PRESS: 'legacyAction:touchLongPress',
|
|
187
|
+
LEGACY_ACTION_TOUCH_FLICK: 'legacyAction:touchFlick',
|
|
188
|
+
LEGACY_ACTION_TOUCH_SINGLE_TAP: 'legacyAction:singleTap',
|
|
189
|
+
LEGACY_ACTION_TOUCH_DOUBLE_TAP: 'legacyAction:doubleTap',
|
|
212
190
|
};
|
|
213
191
|
|
|
214
192
|
|
|
215
193
|
|
|
216
194
|
/**
|
|
217
195
|
* Handles the execution of WebDriver {@link Command commands}.
|
|
218
|
-
* @
|
|
196
|
+
* @record
|
|
219
197
|
*/
|
|
220
198
|
class Executor {
|
|
221
199
|
/**
|
package/lib/error.js
CHANGED
|
@@ -28,6 +28,27 @@ class WebDriverError extends Error {
|
|
|
28
28
|
|
|
29
29
|
/** @override */
|
|
30
30
|
this.name = this.constructor.name;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A stacktrace reported by the remote webdriver endpoint that initially
|
|
34
|
+
* reported this error. This property will be an empty string if the remote
|
|
35
|
+
* end did not provide a stacktrace.
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
this.remoteStacktrace = '';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Indicates a {@linkplain ./webdriver.WebElement#click click command} could not
|
|
45
|
+
* completed because the click target is obscured by other elements on the
|
|
46
|
+
* page.
|
|
47
|
+
*/
|
|
48
|
+
class ElementClickInterceptedError extends WebDriverError {
|
|
49
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
50
|
+
constructor(opt_error) {
|
|
51
|
+
super(opt_error);
|
|
31
52
|
}
|
|
32
53
|
}
|
|
33
54
|
|
|
@@ -44,10 +65,24 @@ class ElementNotSelectableError extends WebDriverError {
|
|
|
44
65
|
|
|
45
66
|
|
|
46
67
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
68
|
+
* Indicates a command could not be completed because the target element is
|
|
69
|
+
* not pointer or keyboard interactable. This will often occur if an element
|
|
70
|
+
* is present in the DOM, but not rendered (i.e. its CSS style has
|
|
71
|
+
* "display: none").
|
|
72
|
+
*/
|
|
73
|
+
class ElementNotInteractableError extends WebDriverError {
|
|
74
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
75
|
+
constructor(opt_error) {
|
|
76
|
+
super(opt_error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Indicates a navigation event caused the browser to generate a certificate
|
|
83
|
+
* warning. This is usually caused by an expired or invalid TLS certificate.
|
|
49
84
|
*/
|
|
50
|
-
class
|
|
85
|
+
class InsecureCertificateError extends WebDriverError {
|
|
51
86
|
/** @param {string=} opt_error the error message, if any. */
|
|
52
87
|
constructor(opt_error) {
|
|
53
88
|
super(opt_error);
|
|
@@ -81,7 +116,7 @@ class InvalidCookieDomainError extends WebDriverError {
|
|
|
81
116
|
/**
|
|
82
117
|
* The coordinates provided to an interactions operation are invalid.
|
|
83
118
|
*/
|
|
84
|
-
class
|
|
119
|
+
class InvalidCoordinatesError extends WebDriverError {
|
|
85
120
|
/** @param {string=} opt_error the error message, if any. */
|
|
86
121
|
constructor(opt_error) {
|
|
87
122
|
super(opt_error);
|
|
@@ -158,6 +193,18 @@ class NoSuchAlertError extends WebDriverError {
|
|
|
158
193
|
}
|
|
159
194
|
|
|
160
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Indicates a named cookie could not be found in the cookie jar for the
|
|
198
|
+
* currently selected document.
|
|
199
|
+
*/
|
|
200
|
+
class NoSuchCookieError extends WebDriverError {
|
|
201
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
202
|
+
constructor(opt_error) {
|
|
203
|
+
super(opt_error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
161
208
|
/**
|
|
162
209
|
* An element could not be located on the page using the given search
|
|
163
210
|
* parameters.
|
|
@@ -332,6 +379,7 @@ class UnsupportedOperationError extends WebDriverError {
|
|
|
332
379
|
*/
|
|
333
380
|
const ErrorCode = {
|
|
334
381
|
SUCCESS: 0,
|
|
382
|
+
NO_SUCH_SESSION: 6,
|
|
335
383
|
NO_SUCH_ELEMENT: 7,
|
|
336
384
|
NO_SUCH_FRAME: 8,
|
|
337
385
|
UNKNOWN_COMMAND: 9,
|
|
@@ -359,16 +407,21 @@ const ErrorCode = {
|
|
|
359
407
|
SQL_DATABASE_ERROR: 35,
|
|
360
408
|
INVALID_XPATH_SELECTOR: 51,
|
|
361
409
|
INVALID_XPATH_SELECTOR_RETURN_TYPE: 52,
|
|
410
|
+
ELEMENT_NOT_INTERACTABLE: 60,
|
|
411
|
+
INVALID_ARGUMENT: 61,
|
|
412
|
+
NO_SUCH_COOKIE: 62,
|
|
413
|
+
UNABLE_TO_CAPTURE_SCREEN: 63,
|
|
414
|
+
ELEMENT_CLICK_INTERCEPTED: 64,
|
|
362
415
|
METHOD_NOT_ALLOWED: 405
|
|
363
416
|
};
|
|
364
417
|
|
|
365
418
|
|
|
366
419
|
const LEGACY_ERROR_CODE_TO_TYPE = new Map([
|
|
420
|
+
[ErrorCode.NO_SUCH_SESSION, NoSuchSessionError],
|
|
367
421
|
[ErrorCode.NO_SUCH_ELEMENT, NoSuchElementError],
|
|
368
422
|
[ErrorCode.NO_SUCH_FRAME, NoSuchFrameError],
|
|
369
423
|
[ErrorCode.UNSUPPORTED_OPERATION, UnsupportedOperationError],
|
|
370
424
|
[ErrorCode.STALE_ELEMENT_REFERENCE, StaleElementReferenceError],
|
|
371
|
-
[ErrorCode.ELEMENT_NOT_VISIBLE, ElementNotVisibleError],
|
|
372
425
|
[ErrorCode.INVALID_ELEMENT_STATE, InvalidElementStateError],
|
|
373
426
|
[ErrorCode.UNKNOWN_ERROR, WebDriverError],
|
|
374
427
|
[ErrorCode.ELEMENT_NOT_SELECTABLE, ElementNotSelectableError],
|
|
@@ -381,28 +434,36 @@ const LEGACY_ERROR_CODE_TO_TYPE = new Map([
|
|
|
381
434
|
[ErrorCode.UNEXPECTED_ALERT_OPEN, UnexpectedAlertOpenError],
|
|
382
435
|
[ErrorCode.NO_SUCH_ALERT, NoSuchAlertError],
|
|
383
436
|
[ErrorCode.SCRIPT_TIMEOUT, ScriptTimeoutError],
|
|
384
|
-
[ErrorCode.INVALID_ELEMENT_COORDINATES,
|
|
437
|
+
[ErrorCode.INVALID_ELEMENT_COORDINATES, InvalidCoordinatesError],
|
|
385
438
|
[ErrorCode.INVALID_SELECTOR_ERROR, InvalidSelectorError],
|
|
386
439
|
[ErrorCode.SESSION_NOT_CREATED, SessionNotCreatedError],
|
|
387
440
|
[ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS, MoveTargetOutOfBoundsError],
|
|
388
441
|
[ErrorCode.INVALID_XPATH_SELECTOR, InvalidSelectorError],
|
|
389
442
|
[ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPE, InvalidSelectorError],
|
|
443
|
+
[ErrorCode.ELEMENT_NOT_INTERACTABLE, ElementNotInteractableError],
|
|
444
|
+
[ErrorCode.INVALID_ARGUMENT, InvalidArgumentError],
|
|
445
|
+
[ErrorCode.NO_SUCH_COOKIE, NoSuchCookieError],
|
|
446
|
+
[ErrorCode.UNABLE_TO_CAPTURE_SCREEN, UnableToCaptureScreenError],
|
|
447
|
+
[ErrorCode.ELEMENT_CLICK_INTERCEPTED, ElementClickInterceptedError],
|
|
390
448
|
[ErrorCode.METHOD_NOT_ALLOWED, UnsupportedOperationError]]);
|
|
391
449
|
|
|
392
450
|
|
|
393
451
|
const ERROR_CODE_TO_TYPE = new Map([
|
|
394
452
|
['unknown error', WebDriverError],
|
|
453
|
+
['element click intercepted', ElementClickInterceptedError],
|
|
454
|
+
['element not interactable', ElementNotInteractableError],
|
|
395
455
|
['element not selectable', ElementNotSelectableError],
|
|
396
|
-
['
|
|
456
|
+
['insecure certificate', InsecureCertificateError],
|
|
397
457
|
['invalid argument', InvalidArgumentError],
|
|
398
458
|
['invalid cookie domain', InvalidCookieDomainError],
|
|
399
|
-
['invalid
|
|
459
|
+
['invalid coordinates', InvalidCoordinatesError],
|
|
400
460
|
['invalid element state', InvalidElementStateError],
|
|
401
461
|
['invalid selector', InvalidSelectorError],
|
|
402
462
|
['invalid session id', NoSuchSessionError],
|
|
403
463
|
['javascript error', JavascriptError],
|
|
404
464
|
['move target out of bounds', MoveTargetOutOfBoundsError],
|
|
405
465
|
['no such alert', NoSuchAlertError],
|
|
466
|
+
['no such cookie', NoSuchCookieError],
|
|
406
467
|
['no such element', NoSuchElementError],
|
|
407
468
|
['no such frame', NoSuchFrameError],
|
|
408
469
|
['no such window', NoSuchWindowError],
|
|
@@ -486,7 +547,14 @@ function isErrorResponse(data) {
|
|
|
486
547
|
function throwDecodedError(data) {
|
|
487
548
|
if (isErrorResponse(data)) {
|
|
488
549
|
let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError;
|
|
489
|
-
|
|
550
|
+
let err = new ctor(data.message);
|
|
551
|
+
// TODO(jleyba): remove whichever case is excluded from the final W3C spec.
|
|
552
|
+
if (typeof data.stacktrace === 'string') {
|
|
553
|
+
err.remoteStacktrace = data.stacktrace;
|
|
554
|
+
} else if (typeof data.stackTrace === 'string') {
|
|
555
|
+
err.remoteStacktrace = data.stackTrace;
|
|
556
|
+
}
|
|
557
|
+
throw err;
|
|
490
558
|
}
|
|
491
559
|
throw new WebDriverError('Unknown error: ' + JSON.stringify(data));
|
|
492
560
|
}
|
|
@@ -532,37 +600,40 @@ function checkLegacyResponse(responseObj) {
|
|
|
532
600
|
|
|
533
601
|
|
|
534
602
|
module.exports = {
|
|
535
|
-
ErrorCode
|
|
536
|
-
|
|
537
|
-
WebDriverError
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
603
|
+
ErrorCode,
|
|
604
|
+
|
|
605
|
+
WebDriverError,
|
|
606
|
+
ElementClickInterceptedError,
|
|
607
|
+
ElementNotInteractableError,
|
|
608
|
+
ElementNotSelectableError,
|
|
609
|
+
InsecureCertificateError,
|
|
610
|
+
InvalidArgumentError,
|
|
611
|
+
InvalidCookieDomainError,
|
|
612
|
+
InvalidCoordinatesError,
|
|
613
|
+
InvalidElementStateError,
|
|
614
|
+
InvalidSelectorError,
|
|
615
|
+
JavascriptError,
|
|
616
|
+
MoveTargetOutOfBoundsError,
|
|
617
|
+
NoSuchAlertError,
|
|
618
|
+
NoSuchCookieError,
|
|
619
|
+
NoSuchElementError,
|
|
620
|
+
NoSuchFrameError,
|
|
621
|
+
NoSuchSessionError,
|
|
622
|
+
NoSuchWindowError,
|
|
623
|
+
ScriptTimeoutError,
|
|
624
|
+
SessionNotCreatedError,
|
|
625
|
+
StaleElementReferenceError,
|
|
626
|
+
TimeoutError,
|
|
627
|
+
UnableToSetCookieError,
|
|
628
|
+
UnableToCaptureScreenError,
|
|
629
|
+
UnexpectedAlertOpenError,
|
|
630
|
+
UnknownCommandError,
|
|
631
|
+
UnknownMethodError,
|
|
632
|
+
UnsupportedOperationError,
|
|
633
|
+
|
|
634
|
+
checkResponse,
|
|
635
|
+
checkLegacyResponse,
|
|
636
|
+
encodeError,
|
|
637
|
+
isErrorResponse,
|
|
638
|
+
throwDecodedError,
|
|
568
639
|
};
|