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/CHANGES.md
CHANGED
|
@@ -1,3 +1,276 @@
|
|
|
1
|
+
## v4.0.0-alpha.1
|
|
2
|
+
|
|
3
|
+
### Notice
|
|
4
|
+
|
|
5
|
+
* The minimum supported version of Node is now 8.9.0 LTS
|
|
6
|
+
|
|
7
|
+
### Changes to Supported Browsers
|
|
8
|
+
|
|
9
|
+
Native support has been removed for Opera and PhantomJS as the WebDriver
|
|
10
|
+
implementations for these browsers are no longer under active development.
|
|
11
|
+
|
|
12
|
+
For Opera, users should be able to simply rely on testing Chrome as the Opera
|
|
13
|
+
browser is based on Chromium (and the operadriver was a thin wrapper around
|
|
14
|
+
chromedriver). For PhantomJS, users should use Chrome or Firefox in headless
|
|
15
|
+
mode (see `example/headless.js`)
|
|
16
|
+
|
|
17
|
+
### Changes for W3C WebDriver Spec Compliance
|
|
18
|
+
|
|
19
|
+
* Revamped the actions API to conform with the WebDriver Spec:
|
|
20
|
+
<https://www.w3.org/TR/webdriver/#actions>. For details, refer to the JS doc
|
|
21
|
+
on the `lib/input.Actions` class.
|
|
22
|
+
|
|
23
|
+
As of January, 2018, only Firefox natively supports this new API. You can
|
|
24
|
+
put the `Actions` class into "bridge mode" and it will attempt to translate
|
|
25
|
+
mouse and keyboard actions to the legacy API (see class docs). Alternatively,
|
|
26
|
+
you may continue to use the legacy API directly via the `lib/actions` module.
|
|
27
|
+
__NOTE:__ The legacy API is considered strongly deprecated and will be
|
|
28
|
+
removed in a minor release once Google's Chrome and Microsoft's Edge browsers
|
|
29
|
+
support the new API.
|
|
30
|
+
|
|
31
|
+
* All window manipulation commands are now supported.
|
|
32
|
+
* Added `driver.switchTo().parentFrame()`
|
|
33
|
+
* When a named cookie is requested, attempt to fetch it directly using the
|
|
34
|
+
W3C endpoint, `GET /session/{session id}/cookie/{name}`. If this command is
|
|
35
|
+
not recognized by the remote end, fallback to fetching all cookies and then
|
|
36
|
+
searching for the desired name.
|
|
37
|
+
* Replaced `WebElement.getSize()` and `WebElement.getLocation()` with a single
|
|
38
|
+
method, `WebElement.getRect()`.
|
|
39
|
+
|
|
40
|
+
### API Changes
|
|
41
|
+
|
|
42
|
+
* The core WebDriver API no longer uses promise manager
|
|
43
|
+
- Removed `index.Builder#setControlFlow()`
|
|
44
|
+
- The following thenable types no longer have a `cancel()` method:
|
|
45
|
+
- The dynamically generated thenable WebDrivers created by `index.Builder`
|
|
46
|
+
- `lib/webdriver.AlertPromise`
|
|
47
|
+
- `lib/webdriver.WebElementPromise`
|
|
48
|
+
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead)
|
|
49
|
+
* Removed the `lib/actions` module
|
|
50
|
+
* Removed the `lib/events` module
|
|
51
|
+
* Removed the `phantomjs` module
|
|
52
|
+
* Removed the 'opera' module
|
|
53
|
+
* Removed the promise manager from `lib/promise`, which includes the removal
|
|
54
|
+
of the following exported names (replacements, if any, in parentheses):
|
|
55
|
+
- CancellableThenable
|
|
56
|
+
- CancellationError
|
|
57
|
+
- ControlFlow
|
|
58
|
+
- Deferred
|
|
59
|
+
- LONG_STACK_TRACES
|
|
60
|
+
- MultipleUnhandledRejectionError
|
|
61
|
+
- Promise (use native Promises)
|
|
62
|
+
- Resolver
|
|
63
|
+
- Scheduler
|
|
64
|
+
- Thenable
|
|
65
|
+
- USE_PROMISE_MANAGER
|
|
66
|
+
- all (use Promise.all)
|
|
67
|
+
- asap (use Promise.resolve)
|
|
68
|
+
- captureStackTrace (use Error.captureStackTrace)
|
|
69
|
+
- consume (use async functions)
|
|
70
|
+
- controlFlow
|
|
71
|
+
- createPromise (use new Promise)
|
|
72
|
+
- defer
|
|
73
|
+
- fulfilled (use Promise.resolve)
|
|
74
|
+
- isGenerator
|
|
75
|
+
- rejected (use Promise.reject)
|
|
76
|
+
- setDefaultFlow
|
|
77
|
+
- when (use Promise.resolve)
|
|
78
|
+
* Changes to the `Builder` class:
|
|
79
|
+
- Added setChromeService, setEdgeService, & setFirefoxService
|
|
80
|
+
- Removed setEnableNativeEvents
|
|
81
|
+
- Removed setScrollBehavior
|
|
82
|
+
* Changes to `chrome.Driver`
|
|
83
|
+
- Added sendDevToolsCommand
|
|
84
|
+
- Added setDownloadPath
|
|
85
|
+
* Changes to `chrome.Options`
|
|
86
|
+
- Now extends the `Capabilities` class
|
|
87
|
+
- Removed from/toCapabilities
|
|
88
|
+
* Changes to `edge.Options`
|
|
89
|
+
- Now extends the `Capabilities` class
|
|
90
|
+
- Removed from/toCapabilities
|
|
91
|
+
* Changes to `ie.Options`
|
|
92
|
+
- Now extends the `Capabilities` class
|
|
93
|
+
- Removed from/toCapabilities
|
|
94
|
+
* Removed the `firefox.Binary` class. Custom binaries can still be selected
|
|
95
|
+
using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be
|
|
96
|
+
specified with `firefox.Options#addArguments()`.
|
|
97
|
+
* Changes to `firefox.Driver`
|
|
98
|
+
- Added installAddon(path)
|
|
99
|
+
- Added uninstallAddon(id)
|
|
100
|
+
* Changes to `firefox.Options`
|
|
101
|
+
- Now extends the `Capabilities` class
|
|
102
|
+
- Removed from/toCapabilities
|
|
103
|
+
- Removed setLoggingPreferences (was a no-op)
|
|
104
|
+
- setProfile now only accepts a path to an existing profile
|
|
105
|
+
- Added addExtensions
|
|
106
|
+
- Added setPreference
|
|
107
|
+
* Removed the `firefox.Profile` class. All of its functionality is now
|
|
108
|
+
provided directly by `firefox.Options`
|
|
109
|
+
* Removed the `firefox/binary` module
|
|
110
|
+
* Removed the `firefox/profile` module
|
|
111
|
+
* Changes to `safari.Options`
|
|
112
|
+
- Now extends the `Capabilities` class
|
|
113
|
+
- Removed from/toCapabilities
|
|
114
|
+
- Removed setCleanSession (was a no-op)
|
|
115
|
+
* Changes to `lib/capabilities.Browser`:
|
|
116
|
+
- Removed several enum values.
|
|
117
|
+
- ANDROID (use Chrome for Android; see docs on the chrome module)
|
|
118
|
+
- IPAD (no support available)
|
|
119
|
+
- IPHONE (no support available)
|
|
120
|
+
- OPERA (use Chrome)
|
|
121
|
+
- PHANTOM_JS (use Chrome or Firefox in headless mode)
|
|
122
|
+
- HTMLUNIT (use Chrome or Firefox in headless mode)
|
|
123
|
+
* Changes to `lib/capabilities.Capabilities`:
|
|
124
|
+
- Removed static factory methods android(), ipad(), iphone(), opera(),
|
|
125
|
+
phantomjs(), htmlunit(), and htmlunitwithjs(). Users can still manually
|
|
126
|
+
configure capabilities for these, but their use is not recommended and
|
|
127
|
+
they will no longer be surfaced in the API.
|
|
128
|
+
* Changes to `lib/error`:
|
|
129
|
+
- Added
|
|
130
|
+
- ElementClickInterceptedError
|
|
131
|
+
- InsecureCertificateError
|
|
132
|
+
- InvalidCoordinatesError
|
|
133
|
+
- NoSuchCookieError
|
|
134
|
+
- Removed
|
|
135
|
+
- ElementNotVisibleError
|
|
136
|
+
- InvalidElementCoordinatesError
|
|
137
|
+
* Changes to `lib/webdriver.WebDriver`:
|
|
138
|
+
- Dropped support for "requiredCapabilities" from WebDriver.createSession
|
|
139
|
+
- actions() now returns the new `lib/input.Actions` class
|
|
140
|
+
- Removed touchActions
|
|
141
|
+
- Renamed schedule to execute
|
|
142
|
+
- Removed the `WebDriver.attachToSession()` factory method. Users can just
|
|
143
|
+
the `WebDriver` constructor directly instead.
|
|
144
|
+
- Removed the `call()` method. This was used to inject custom function calls
|
|
145
|
+
into the control flow. Now that the promise manager is no longer used,
|
|
146
|
+
this method is no longer necessary. Users are now responsible for
|
|
147
|
+
coordinating actions (ideally with async functions) and can just call
|
|
148
|
+
functions directly instead of through `driver.call()`.
|
|
149
|
+
* Changes to `lib/webdriver.WebElement`:
|
|
150
|
+
- Replaced getSize & getLocation with getRect
|
|
151
|
+
* Changes to `lib/webdriver.Alert`:
|
|
152
|
+
- Removed authenticateAs
|
|
153
|
+
* Changes to `lib/webdriver.Options` (`driver.manage()`):
|
|
154
|
+
- Removed timeouts (use get/setTimeouts)
|
|
155
|
+
* Changes to `lib/webdriver.Window` (`driver.manage().window()`):
|
|
156
|
+
- Added
|
|
157
|
+
- getRect
|
|
158
|
+
- setRect
|
|
159
|
+
- fullscreen
|
|
160
|
+
- minimize
|
|
161
|
+
- Removed (use the getRect/setRect methods)
|
|
162
|
+
- getPosition
|
|
163
|
+
- setPosition
|
|
164
|
+
- getSize
|
|
165
|
+
- setSize
|
|
166
|
+
* Removed the `testing/assert` module
|
|
167
|
+
* Changes to `testing/index`
|
|
168
|
+
- Since the promise manager has been removed, it is no longer necessary to
|
|
169
|
+
wrap the Mocha test hooks; instead, users can simply use async functions.
|
|
170
|
+
The following have all been removed:
|
|
171
|
+
- describe
|
|
172
|
+
- before
|
|
173
|
+
- beforeEach
|
|
174
|
+
- after
|
|
175
|
+
- afterEach
|
|
176
|
+
- it
|
|
177
|
+
- Added the `suite` function. For details, refer to the jsdoc or
|
|
178
|
+
`example/google_search_test.js`
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## v3.6.0
|
|
183
|
+
|
|
184
|
+
### Bug Fixes
|
|
185
|
+
|
|
186
|
+
* The Capabilities factory methods should only specify the name of the browser.
|
|
187
|
+
* Protect against the remote end sometimes not returning a list to findElements
|
|
188
|
+
commands.
|
|
189
|
+
* Properly reset state in `remote.DriverService#kill()`
|
|
190
|
+
* The firefox module will no longer apply the preferences required by the legacy
|
|
191
|
+
FirefoxDriver. These preferences were only required when using the legacy
|
|
192
|
+
driver, support for which was dropped in v3.5.0.
|
|
193
|
+
|
|
194
|
+
### API Changes
|
|
195
|
+
|
|
196
|
+
* Added new methods to `selenium-webdriver/firefox.Options`:
|
|
197
|
+
- addArguments()
|
|
198
|
+
- headless()
|
|
199
|
+
- windowSize()
|
|
200
|
+
* Deprecated `selenium-webdriver/firefox/binary.Binary`
|
|
201
|
+
* Removed `selenium-webdriver/firefox.Options#useGeckoDriver()`
|
|
202
|
+
* Removed the unused `selenium-webdriver/firefox/profile.decode()`
|
|
203
|
+
* Removed methods from `selenium-webdriver/firefox/profile.Profile` that had
|
|
204
|
+
no effect since support for the legacy FirefoxDriver was dropped in 3.5.0:
|
|
205
|
+
- setNativeEventsEnabled
|
|
206
|
+
- nativeEventsEnabled
|
|
207
|
+
- getPort
|
|
208
|
+
- setPort
|
|
209
|
+
* Removed `selenium-webdriver/firefox.ServiceBuilder#setFirefoxBinary()`; custom
|
|
210
|
+
binaries should be configured through the `firefox.Options` class.
|
|
211
|
+
* Removed `selenium-webdriver/firefox.Capability`. These hold overs from the
|
|
212
|
+
legacy FirefoxDriver are no longer supported.
|
|
213
|
+
|
|
214
|
+
### Changes for W3C WebDriver Spec Compliance
|
|
215
|
+
|
|
216
|
+
* Deprecated `error.ElementNotVisibleError` in favor of the more generic
|
|
217
|
+
`error.ElementNotInteractableError`.
|
|
218
|
+
* Support the `httpOnly` option when adding a cookie.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## v3.5.0
|
|
222
|
+
|
|
223
|
+
### Notice
|
|
224
|
+
|
|
225
|
+
Native support for Firefox 45 (ESR) has been removed. Users will have to connect
|
|
226
|
+
to a remote Selenium server that supports Firefox 45.
|
|
227
|
+
|
|
228
|
+
### Changes
|
|
229
|
+
|
|
230
|
+
* Removed native support for Firefox 46 and older.
|
|
231
|
+
- The `SELENIUM_MARIONETTE` enviornment variable no longer has an effect.
|
|
232
|
+
- `selenium-webdriver/firefox.Capability.MARIONETTE` is deprecated.
|
|
233
|
+
- `selenium-webdriver/firefox.Options#useGeckoDriver()` is deprecated and now a no-op.
|
|
234
|
+
* `firefox.Options` will no longer discard the `"moz:firefoxOptions"` set in
|
|
235
|
+
user provided capabilities (via `Builder.withCapabilities({})`). When both
|
|
236
|
+
are used, the settings in `firefox.Options` will be applied _last_.
|
|
237
|
+
* Added `chrome.Options#headless()` and `chrome.Options#windowSize()`, which
|
|
238
|
+
may be used to start Chrome in headless mode (requires Chrome 59+) and to set
|
|
239
|
+
the initial window size, respectively.
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
### Changes for W3C WebDriver Spec Compliance
|
|
243
|
+
|
|
244
|
+
* Added `error.WebDriverError#remoteStacktrace` to capture the stacktrace
|
|
245
|
+
reported by a remote WebDriver endpoint (if any).
|
|
246
|
+
* Fixed `WebElement#sendKeys` to send text as a string instead of an array of
|
|
247
|
+
strings.
|
|
248
|
+
|
|
249
|
+
## v3.4.0
|
|
250
|
+
|
|
251
|
+
### Notice
|
|
252
|
+
|
|
253
|
+
This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodriver/releases/tag/v0.15.0) or newer.
|
|
254
|
+
|
|
255
|
+
### API Changes
|
|
256
|
+
|
|
257
|
+
* Added `Options#getTimeouts()` for retrieving the currently configured session
|
|
258
|
+
timeouts (i.e. implicit wait). This method will only work with W3C compatible
|
|
259
|
+
WebDriver implementations.
|
|
260
|
+
* Deprecated the `Timeouts` class in favor of `Options#setTimeouts()`, which
|
|
261
|
+
supports setting multiple timeouts at once.
|
|
262
|
+
* Added support for emulating different network conditions (e.g., offline, 2G, WiFi) on Chrome.
|
|
263
|
+
|
|
264
|
+
### Changes for W3C WebDriver Spec Compliance
|
|
265
|
+
|
|
266
|
+
* Fixed W3C response parsing, which expects response data to always be a JSON
|
|
267
|
+
object with a `value` key.
|
|
268
|
+
* Added W3C endpoints for interacting with various types of
|
|
269
|
+
[user prompts](https://w3c.github.io/webdriver/webdriver-spec.html#user-prompts).
|
|
270
|
+
* Added W3C endpoints for remotely executing scripts.
|
|
271
|
+
* Added W3C endpoints to get current window handle and all windows handles.
|
|
272
|
+
|
|
273
|
+
|
|
1
274
|
## v3.3.0
|
|
2
275
|
|
|
3
276
|
* Added warning log messages when the user creates new managed promises, or
|
package/NOTICE
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Copyright 2011-
|
|
1
|
+
Copyright 2011-2017 Software Freedom Conservancy
|
|
2
2
|
Copyright 2004-2011 Selenium committers
|
package/README.md
CHANGED
|
@@ -11,14 +11,11 @@ Selenium may be installed via npm with
|
|
|
11
11
|
npm install selenium-webdriver
|
|
12
12
|
|
|
13
13
|
You will need to download additional components to work with each of the major
|
|
14
|
-
browsers. The drivers for Chrome, Firefox,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
> **NOTE:** Mozilla's [geckodriver] is only required for Firefox 47+.
|
|
21
|
-
> Everything you need for Firefox 38-46 is included with this package.
|
|
14
|
+
browsers. The drivers for Chrome, Firefox, and Microsoft's IE and Edge web
|
|
15
|
+
browsers are all standalone executables that should be placed on your system
|
|
16
|
+
[PATH]. Apple's safaridriver is shipped with Safari 10 for OS X El Capitan and
|
|
17
|
+
macOS Sierra. You will need to enable Remote Automation in the Develop menu of
|
|
18
|
+
Safari 10 before testing.
|
|
22
19
|
|
|
23
20
|
|
|
24
21
|
| Browser | Component |
|
|
@@ -26,9 +23,7 @@ Automation in the Develop menu of Safari 10 before testing.
|
|
|
26
23
|
| Chrome | [chromedriver(.exe)][chrome] |
|
|
27
24
|
| Internet Explorer | [IEDriverServer.exe][release] |
|
|
28
25
|
| Edge | [MicrosoftWebDriver.msi][edge] |
|
|
29
|
-
| Firefox
|
|
30
|
-
| PhantomJS | [phantomjs(.exe)][phantomjs] |
|
|
31
|
-
| Opera | [operadriver(.exe)][opera] |
|
|
26
|
+
| Firefox | [geckodriver(.exe)][geckodriver] |
|
|
32
27
|
| Safari | [safaridriver] |
|
|
33
28
|
|
|
34
29
|
## Usage
|
|
@@ -36,19 +31,18 @@ Automation in the Develop menu of Safari 10 before testing.
|
|
|
36
31
|
The sample below and others are included in the `example` directory. You may
|
|
37
32
|
also find the tests for selenium-webdriver informative.
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
By = webdriver.By,
|
|
41
|
-
until = webdriver.until;
|
|
42
|
-
|
|
43
|
-
var driver = new webdriver.Builder()
|
|
44
|
-
.forBrowser('firefox')
|
|
45
|
-
.build();
|
|
34
|
+
const {Builder, By, Key, until} = require('selenium-webdriver');
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
(async function example() {
|
|
37
|
+
let driver = await new Builder().forBrowser('firefox').build();
|
|
38
|
+
try {
|
|
39
|
+
await driver.get('http://www.google.com/ncr');
|
|
40
|
+
await driver.findElement(By.name('q'));.sendKeys('webdriver', Key.RETURN);
|
|
41
|
+
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
|
|
42
|
+
} finally {
|
|
43
|
+
await driver.quit();
|
|
44
|
+
}
|
|
45
|
+
})();
|
|
52
46
|
|
|
53
47
|
### Using the Builder API
|
|
54
48
|
|
|
@@ -57,11 +51,11 @@ instances. Rather than clutter your code with branches for the various browsers,
|
|
|
57
51
|
the builder lets you set all options in one flow. When you call
|
|
58
52
|
`Builder#build()`, all options irrelevant to the selected browser are dropped:
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
const webdriver = require('selenium-webdriver');
|
|
55
|
+
const chrome = require('selenium-webdriver/chrome');
|
|
56
|
+
const firefox = require('selenium-webdriver/firefox');
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
let driver = new webdriver.Builder()
|
|
65
59
|
.forBrowser('firefox')
|
|
66
60
|
.setChromeOptions(/* ... */)
|
|
67
61
|
.setFirefoxOptions(/* ... */)
|
|
@@ -98,7 +92,7 @@ server with
|
|
|
98
92
|
You may configure your tests to run against a remote server through the Builder
|
|
99
93
|
API:
|
|
100
94
|
|
|
101
|
-
|
|
95
|
+
let driver = new webdriver.Builder()
|
|
102
96
|
.forBrowser('firefox')
|
|
103
97
|
.usingServer('http://localhost:4444/wd/hub')
|
|
104
98
|
.build();
|
|
@@ -168,11 +162,11 @@ months, the support window for selenium-webdriver will be roughly:
|
|
|
168
162
|
|
|
169
163
|
| Date | LTS | Stable |
|
|
170
164
|
| --------- | ---: | -----: |
|
|
171
|
-
| (current) |
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
165
|
+
| (current) | 8.9 | 9.0 |
|
|
166
|
+
| 2018-04 | 8.x | 10.0 |
|
|
167
|
+
| 2018-10 | 10.x | 11.0 |
|
|
168
|
+
| 2019-04 | 10.x | 12.0 |
|
|
169
|
+
| 2019-10 | 12.x | 13.0 |
|
|
176
170
|
|
|
177
171
|
## Issues
|
|
178
172
|
|
|
@@ -193,7 +187,7 @@ the issue tracker
|
|
|
193
187
|
- __Do not__ post empty "I see this too" or "Any updates?" comments. These
|
|
194
188
|
provide no additional information and clutter the log.
|
|
195
189
|
- __Do not__ report regressions on closed bugs as they are not actively
|
|
196
|
-
monitored for
|
|
190
|
+
monitored for updates (especially bugs that are >6 months old). Please open a
|
|
197
191
|
new issue and reference the original bug in your report.
|
|
198
192
|
|
|
199
193
|
## License
|
|
@@ -222,8 +216,6 @@ under the License.
|
|
|
222
216
|
[chrome]: http://chromedriver.storage.googleapis.com/index.html
|
|
223
217
|
[gh]: https://github.com/SeleniumHQ/selenium/
|
|
224
218
|
[issues]: https://github.com/SeleniumHQ/selenium/issues
|
|
225
|
-
[opera]: https://github.com/operasoftware/operachromiumdriver/releases
|
|
226
|
-
[phantomjs]: http://phantomjs.org/
|
|
227
219
|
[edge]: http://go.microsoft.com/fwlink/?LinkId=619687
|
|
228
220
|
[geckodriver]: https://github.com/mozilla/geckodriver/releases/
|
|
229
221
|
[reduction]: http://www.webkit.org/quality/reduction.html
|