UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

317 lines (313 loc) 20 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Changes</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article class="indexfile"><h2>v2.47.0</h2> <h3>Notice</h3> <p>This is the last release for <code>selenium-webdriver</code> that will support ES5. Subsequent releases will depend on ES6 features that are enabled by <a href="https://nodejs.org/en/docs/es6/">default</a> in Node v4.0.0. Node v0.12.x will continue to be supported, but will require setting the <code>--harmony</code> flag.</p> <h3>Change Summary</h3> <ul><li>Add support for <a href="https://nodejs.org/en/blog/release/v4.0.0/">Node v4.0.0</a> <ul><li>Updated <code>ws</code> dependency from <code>0.7.1</code> to <code>0.8.0</code></li></ul> </li><li>Bumped the minimum supported version of Node from <code>0.10.x</code> to <code>0.12.x</code>. This is in accordance with the Node support policy established in <code>v2.45.0</code>.</li></ul> <h2>v2.46.1</h2> <ul><li>Fixed internal module loading on Windows.</li><li>Fixed error message format on timeouts for <code>until.elementLocated()</code> and <code>until.elementsLocated()</code>.</li></ul> <h2>v2.46.0</h2> <ul><li>Exposed a new logging API via the <code>webdriver.logging</code> module. For usage, see <code>example/logging.js</code>.</li><li>Added support for using a proxy server for WebDriver commands. See <code>Builder#usingWebDriverProxy()</code> for more info.</li><li>Removed deprecated functions: <ul><li>Capabilities#toJSON()</li><li>UnhandledAlertError#getAlert()</li><li>chrome.createDriver()</li><li>phantomjs.createDriver()</li><li>promise.ControlFlow#annotateError()</li><li>promise.ControlFlow#await()</li><li>promise.ControlFlow#clearHistory()</li><li>promise.ControlFlow#getHistory()</li></ul> </li><li>Removed deprecated enum values: <code>ErrorCode.NO_MODAL_DIALOG_OPEN</code> and <code>ErrorCode.MODAL_DIALOG_OPENED</code>. Use <code>ErrorCode.NO_SUCH_ALERT</code> and <code>ErrorCode.UNEXPECTED_ALERT_OPEN</code>, respectively.</li><li>FIXED: The <code>promise.ControlFlow</code> will maintain state for promise chains generated in a loop.</li><li>FIXED: Correct serialize target elements used in an action sequence.</li><li>FIXED: <code>promise.ControlFlow#wait()</code> now has consistent semantics for an omitted or 0-timeout: it will wait indefinitely.</li><li>FIXED: <code>remote.DriverService#start()</code> will now fail if the child process dies while waiting for the server to start accepting requests. Previously, start would continue to poll the server address until the timeout expired.</li><li>FIXED: Skip launching Firefox with the <code>-silent</code> flag to preheat the profile. Starting with Firefox 38, this would cause the browser to crash. This step, which was first introduced for Selenium&#39;s java client back with Firefox 2, no longer appears to be required.</li><li>FIXED: 8564: <code>firefox.Driver#quit()</code> will wait for the Firefox process to terminate before deleting the temporary webdriver profile. This eliminates a race condition where Firefox would write profile data during shutdown, causing the <code>rm -rf</code> operation on the profile directory to fail.</li></ul> <h2>v2.45.1</h2> <ul><li>FIXED: 8548: Task callbacks are once again dropped if the task was cancelled due to a previously uncaught error within the frame.</li><li>FIXED: 8496: Extended the <code>chrome.Options</code> API to cover all configuration options (e.g. mobile emulation and performance logging) documented on the ChromeDriver <a href="https://sites.google.com/a/chromium.org/chromedriver/capabilities">project site</a>.</li></ul> <h2>v2.45.0</h2> <h3>Important Policy Change</h3> <p>Starting with the 2.45.0 release, selenium-webdriver will support the last two stable minor releases for Node. For 2.45.0, this means Selenium will support Node 0.10.x and 0.12.x. Support for the intermediate, un-stable release (0.11.x) is &#34;best-effort&#34;. This policy will be re-evaluated once Node has a major version release (i.e. 1.0.0).</p> <h3>Change Summary</h3> <ul><li> <p>Added native browser support for Internet Explorer, Opera 26&#43;, and Safari</p> </li><li> <p>With the release of <a href="http://blog.nodejs.org/2015/02/06/node-v0-12-0-stable/">Node 0.12.0</a> (finally!), the minimum supported version of Node is now <code>0.10.x</code>.</p> </li><li> <p>The <code>promise</code> module is now <a href="https://promisesaplus.com/">Promises/A&#43;</a> compliant. The biggest compliance change is that promise callbacks are now invoked in a future turn of the JS event loop. For example:</p> <pre><code> var promise &#61; require(&#39;selenium-webdriver&#39;).promise; console.log(&#39;start&#39;); promise.fulfilled().then(function() { console.log(&#39;middle&#39;); }); console.log(&#39;end&#39;); // Output in selenium-webdriver&#64;2.44.0 // start // middle // end // // Output in selenium-webdriver&#64;2.45.0 // start // end // middle </code></pre> <p>The <code>promise.ControlFlow</code> class has been updated to track the asynchronous breaks required by Promises/A&#43;, so there are no changes to task execution order.</p> </li><li> <p>Updated how errors are annotated on failures. When a task fails, the stacktrace from when that task was scheduled is appended to the rejection reason with a <code>From:</code> prefix (if it is an Error object). For example:</p> <pre><code> var driver &#61; new webdriver.Builder().forBrowser(&#39;chrome&#39;).build(); driver.get(&#39;http://www.google.com/ncr&#39;); driver.call(function() { driver.wait(function() { return driver.isElementPresent(webdriver.By.id(&#39;not-there&#39;)); }, 2000, &#39;element not found&#39;); }); </code></pre> <p>This code will fail an error like:</p> <pre><code> Error: element not found Wait timed out after 2002ms at &lt;stack trace&gt; From: Task: element not found at &lt;stack trace&gt; From: Task: WebDriver.call(function) at &lt;stack trace&gt; </code></pre> </li><li> <p>Changed the format of strings returned by <code>promise.ControlFlow#getSchedule</code>. This function now accepts a boolean to control whether the returned string should include the stacktraces for when each task was scheduled.</p> </li><li> <p>Deprecating <code>promise.ControlFlow#getHistory</code>, <code>promise.ControlFlow#clearHistory</code>, and <code>promise.ControlFlow#annotateError</code>. These functions were all intended for internal use and are no longer necessary, so they have been made no-ops.</p> </li><li> <p><code>WebDriver.wait()</code> may now be used to wait for a promise to resolve, with an optional timeout. Refer to the API documentation for more information.</p> </li><li> <p>Added support for copying files to a remote Selenium via <code>sendKeys</code> to test file uploads. Refer to the API documentation for more information. Sample usage included in <code>test/upload_test.js</code></p> </li><li> <p>Expanded the interactions API to include touch actions. See <code>WebDriver.touchActions()</code>.</p> </li><li> <p>FIXED: 8380: <code>firefox.Driver</code> will delete its temporary profile on <code>quit</code>.</p> </li><li> <p>FIXED: 8306: Stack overflow in promise callbacks eliminated.</p> </li><li> <p>FIXED: 8221: Added support for defining custom command mappings. Includes support for PhantomJS&#39;s <code>executePhantomJS</code> (requires PhantomJS 1.9.7 or GhostDriver 1.1.0).</p> </li><li> <p>FIXED: 8128: When the FirefoxDriver marshals an object to the page for <code>executeScript</code>, it defines additional properties (required by the driver&#39;s implementation). These properties will no longer be enumerable and should be omitted (i.e. they won&#39;t show up in JSON.stringify output).</p> </li><li> <p>FIXED: 8094: The control flow will no longer deadlock when a task returns a promise that depends on the completion of sub-tasks.</p> </li></ul> <h2>v2.44.0</h2> <ul><li> <p>Added the <code>until</code> module, which defines common explicit wait conditions. Sample usage:</p> <pre><code> var firefox &#61; require(&#39;selenium-webdriver/firefox&#39;), until &#61; require(&#39;selenium-webdriver/until&#39;); var driver &#61; new firefox.Driver(); driver.get(&#39;http://www.google.com/ncr&#39;); driver.wait(until.titleIs(&#39;Google Search&#39;), 1000); </code></pre> </li><li> <p>FIXED: 8000: <code>Builder.forBrowser()</code> now accepts an empty string since some WebDriver implementations ignore the value. A value must still be specified, however, since it is a required field in WebDriver&#39;s wire protocol.</p> </li><li> <p>FIXED: 7994: The <code>stacktrace</code> module will not modify stack traces if the initial parse fails (e.g. the user defined <code>Error.prepareStackTrace</code>)</p> </li><li> <p>FIXED: 5855: Added a module (<code>until</code>) that defines several common conditions for use with explicit waits. See updated examples for usage.</p> </li></ul> <h2>v2.43.5</h2> <ul><li>FIXED: 7905: <code>Builder.usingServer(url)</code> once again returns <code>this</code> for chaining.</li></ul> <h2>v2.43.2-4</h2> <ul><li>No changes; version bumps while attempting to work around an issue with publishing to npm (a version string may only be used once).</li></ul> <h2>v2.43.1</h2> <ul><li>Fixed an issue with flakiness when setting up the Firefox profile that could prevent the driver from initializing properly.</li></ul> <h2>v2.43.0</h2> <ul><li> <p>Added native support for Firefox - the Java Selenium server is no longer required.</p> </li><li> <p>Added support for generator functions to <code>ControlFlow#execute</code> and <code>ControlFlow#wait</code>. For more information, see documentation on <code>webdriver.promise.consume</code>. Requires harmony support (run with <code>node --harmony-generators</code> in <code>v0.11.x</code>).</p> </li><li> <p>Various improvements to the <code>Builder</code> API. Notably, the <code>build()</code> function will no longer default to attempting to use a server at <code>http://localhost:4444/wd/hub</code> if it cannot start a browser directly - you must specify the WebDriver server with <code>usingServer(url)</code>. You can also set the target browser and WebDriver server through a pair of environment variables. See the documentation on the <code>Builder</code> constructor for more information.</p> </li><li> <p>For consistency with the other language bindings, added browser specific classes that can be used to start a browser without the builder.</p> <pre><code> var webdriver &#61; require(&#39;selenium-webdriver&#39;) chrome &#61; require(&#39;selenium-webdriver/chrome&#39;); // The following are equivalent. var driver1 &#61; new webdriver.Builder().forBrowser(&#39;chrome&#39;).build(); var driver2 &#61; new chrome.Driver(); </code></pre> </li><li> <p>Promise A&#43; compliance: a promise may no longer resolve to itself.</p> </li><li> <p>For consistency with other language bindings, deprecated <code>UnhandledAlertError#getAlert</code> and added <code>#getAlertText</code>. <code>getAlert</code> will be removed in <code>2.45.0</code>.</p> </li><li> <p>FIXED: 7641: Deprecated <code>ErrorCode.NO_MODAL_DIALOG_OPEN</code> and <code>ErrorCode.MODAL_DIALOG_OPENED</code> in favor of the new <code>ErrorCode.NO_SUCH_ALERT</code> and <code>ErrorCode.UNEXPECTED_ALERT_OPEN</code>, respectively.</p> </li><li> <p>FIXED: 7563: Mocha integration no longer disables timeouts. Default Mocha timeouts apply (2000 ms) and may be changed using <code>this.timeout(ms)</code>.</p> </li><li> <p>FIXED: 7470: Make it easier to create WebDriver instances in custom flows for parallel execution.</p> </li></ul> <h2>v2.42.1</h2> <ul><li>FIXED: 7465: Fixed <code>net.getLoopbackAddress</code> on Windows</li><li>FIXED: 7277: Support <code>done</code> callback in Mocha&#39;s BDD interface</li><li>FIXED: 7156: <code>Promise#thenFinally</code> should not suppress original error</li></ul> <h2>v2.42.0</h2> <ul><li>Removed deprecated functions <code>Promise#addCallback()</code>, <code>Promise#addCallbacks()</code>, <code>Promise#addErrback()</code>, and <code>Promise#addBoth()</code>.</li><li>Fail with a more descriptive error if the server returns a malformed redirect</li><li>FIXED: 7300: Connect to ChromeDriver using the loopback address since ChromeDriver 2.10.267517 binds to localhost by default.</li><li>FIXED: 7339: Preserve wrapped test function&#39;s string representation for Mocha&#39;s BDD interface.</li></ul> <h2>v2.41.0</h2> <ul><li>FIXED: 7138: export logging API from webdriver module.</li><li>FIXED: 7105: beforeEach/it/afterEach properly bind <code>this</code> for Mocha tests.</li></ul> <h2>v2.40.0</h2> <ul><li>API documentation is now included in the docs directory.</li><li>Added utility functions for working with an array of promises: <code>promise.all</code>, <code>promise.map</code>, and <code>promise.filter</code></li><li>Introduced <code>Promise#thenCatch()</code> and <code>Promise#thenFinally()</code>.</li><li>Deprecated <code>Promise#addCallback()</code>, <code>Promise#addCallbacks()</code>, <code>Promise#addErrback()</code>, and <code>Promise#addBoth()</code>.</li><li>Removed deprecated function <code>webdriver.WebDriver#getCapability</code>.</li><li>FIXED: 6826: Added support for custom locators.</li></ul> <h2>v2.39.0</h2> <ul><li>Version bump to stay in sync with the Selenium project.</li></ul> <h2>v2.38.1</h2> <ul><li>FIXED: 6686: Changed <code>webdriver.promise.Deferred#cancel()</code> to silently no-op if the deferred has already been resolved.</li></ul> <h2>v2.38.0</h2> <ul><li>When a promise is rejected, always annotate the stacktrace with the parent flow state so users can identify the source of an error.</li><li>Updated tests to reflect features not working correctly in the SafariDriver (cookie management and proxy support; see issues 5051, 5212, and 5503)</li><li>FIXED: 6284: For mouse moves, correctly omit the x/y offsets if not specified as a function argument (instead of passing (0,0)).</li><li>FIXED: 6471: Updated documentation on <code>webdriver.WebElement#getAttribute</code></li><li>FIXED: 6612: On Unix, use the default IANA ephemeral port range if unable to retrieve the current system&#39;s port range.</li><li>FIXED: 6617: Avoid triggering the node debugger when initializing the stacktrace module.</li><li>FIXED: 6627: Safely rebuild chrome.Options from a partial JSON spec.</li></ul> <h2>v2.37.0</h2> <ul><li>FIXED: 6346: The remote.SeleniumServer class now accepts JVM arguments using the <code>jvmArgs</code> option.</li></ul> <h2>v2.36.0</h2> <ul><li><em>Release skipped to stay in sync with main Selenium project.</em></li></ul> <h2>v2.35.2</h2> <ul><li>FIXED: 6200: Pass arguments to the Selenium server instead of to the JVM.</li></ul> <h2>v2.35.1</h2> <ul><li>FIXED: 6090: Changed example scripts to use chromedriver.</li></ul> <h2>v2.35.0</h2> <ul><li>Version bump to stay in sync with the Selenium project.</li></ul> <h2>v2.34.1</h2> <ul><li>FIXED: 6079: The parent process should not wait for spawn driver service processes (chromedriver, phantomjs, etc.)</li></ul> <h2>v2.34.0</h2> <ul><li> <p>Added the <code>selenium-webdriver/testing/assert</code> module. This module simplifies writing assertions against promised values (see example in module documentation).</p> </li><li> <p>Added the <code>webdriver.Capabilities</code> class.</p> </li><li> <p>Added native support for the ChromeDriver. When using the <code>Builder</code>, requesting chrome without specifying a remote server URL will default to the native ChromeDriver implementation. The <a href="https://code.google.com/p/chromedriver/downloads/list">ChromeDriver server</a> must be downloaded separately.</p> <pre><code> // Will start ChromeDriver locally. var driver &#61; new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). build(); // Will start ChromeDriver using the remote server. var driver &#61; new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). usingServer(&#39;http://server:1234/wd/hub&#39;). build(); </code></pre> </li><li> <p>Added support for configuring proxies through the builder. For examples, see <code>selenium-webdriver/test/proxy_test</code>.</p> </li><li> <p>Added native support for PhantomJS.</p> </li><li> <p>Changed signature of <code>SeleniumServer</code> to <code>SeleniumServer(jar, options)</code>.</p> </li><li> <p>Tests are now included in the npm published package. See <code>README.md</code> for execution instructions</p> </li><li> <p>Removed the deprecated <code>webdriver.Deferred#resolve</code> and <code>webdriver.promise.resolved</code> functions.</p> </li><li> <p>Removed the ability to connect to an existing session from the Builder. This feature is intended for use with the browser-based client.</p> </li></ul> <h2>v2.33.0</h2> <ul><li>Added support for WebDriver&#39;s logging API</li><li>FIXED: 5511: Added webdriver.manage().timeouts().pageLoadTimeout(ms)</li></ul> <h2>v2.32.1</h2> <ul><li>FIXED: 5541: Added missing return statement for windows in <code>portprober.findFreePort()</code></li></ul> <h2>v2.32.0</h2> <ul><li>Added the <code>selenium-webdriver/testing</code> package, which provides a basic framework for writing tests using Mocha. See <code>selenium-webdriver/example/google_search_test.js</code> for usage.</li><li>For Promises/A&#43; compatibility, backing out the change in 2.30.0 that ensured rejections were always Error objects. Rejection reasons are now left as is.</li><li>Removed deprecated functions originally scheduled for removal in 2.31.0 <ul><li>promise.Application.getInstance()</li><li>promise.ControlFlow#schedule()</li><li>promise.ControlFlow#scheduleTimeout()</li><li>promise.ControlFlow#scheduleWait()</li></ul> </li><li>Renamed some functions for consistency with Promises/A&#43; terminology. The original functions have been deprecated and will be removed in 2.34.0: <ul><li>promise.resolved() -&gt; promise.fulfilled()</li><li>promise.Deferred#resolve() -&gt; promise.Deferred#fulfill()</li></ul> </li><li>FIXED: remote.SeleniumServer#stop now shuts down within the active control flow, allowing scripts to finish. Use #kill to shutdown immediately.</li><li>FIXED: 5321: cookie deletion commands</li></ul> <h2>v2.31.0</h2> <ul><li>Added an example script.</li><li>Added a class for controlling the standalone Selenium server (server available separately)</li><li>Added a portprober for finding free ports</li><li>FIXED: WebElements now belong to the same flow as their parent driver.</li></ul> <h2>v2.30.0</h2> <ul><li>Ensures promise rejections are always Error values.</li><li>Version bump to keep in sync with the Selenium project.</li></ul> <h2>v2.29.1</h2> <ul><li>Fixed a bug that could lead to an infinite loop.</li><li>Added a README.md</li></ul> <h2>v2.29.0</h2> <ul><li> <p>Initial release for npm:</p> <pre><code> npm install selenium-webdriver </code></pre> </li></ul> </article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>