UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

158 lines (152 loc) 28.7 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.WebElement</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class webdriver.WebElement</h1><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1575">code &raquo;</a></header><section><p>Represents a DOM element. WebElements can be found by searching from the document root using a <code >webdriver.WebDriver</code> instance, or by searching under another <code >webdriver.WebElement</code>: <pre><code> driver.get('http://www.google.com'); var searchForm = driver.findElement(By.tagName('form')); var searchBox = searchForm.findElement(By.name('q')); searchBox.sendKeys('webdriver'); </code></pre> The WebElement is implemented as a promise for compatibility with the promise API. It will always resolve itself when its internal state has been fully resolved and commands may be issued against the element. This can be used to catch errors when an element cannot be located on the page: <pre><code> driver.findElement(By.id('not-there')).then(function(element) { alert('Found an element that was not expected to be there!'); }, function(error) { alert('The element was not found, as expected'); }); </code></pre><h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.WebElement <span class="args">( driver, id )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>driver: <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code><dd>The parent WebDriver instance for this element.<dt>id: <code class="type">!(<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>&gt;|<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>)</code><dd>The server-assigned opaque ID for the underlying DOM element.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1591">code &raquo;</a><a class="member" name="webdriver.WebElement.Id">webdriver.WebElement.Id</a> : <code class="type">{ELEMENT: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}</code></div><div>Wire protocol definition of a WebElement ID.</div></summary></details></div></div></section><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1992">code &raquo;</a><span class="member"><a name="clear">clear</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;void&gt;</code></span></div><p>Schedules a command to clear the <code >value</code> of this element. This command has no effect if the underlying DOM element is neither a text INPUT element nor a TEXTAREA element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved when the element has been cleared.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1769">code &raquo;</a><span class="member"><a name="click">click</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;void&gt;</code></span></div><p>Schedules a command to click on this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved when the click command has completed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1709">code &raquo;</a><span class="member"><a name="findElement">findElement</a> <span class="args">( locator )</span> &rArr; <code class="type">!<a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code></span></div><p>Schedule a command to find a descendant of this element. If the element cannot be found, a <code >bot.ErrorCode.NO_SUCH_ELEMENT</code> result will be returned by the driver. Unlike other commands, this error cannot be suppressed. In other words, scheduling a command to find an element doubles as an assert that the element is present on the page. To test whether an element is present on the page, use <code >#isElementPresent</code> instead. <p>The search criteria for an element may be defined using one of the factories in the <code class="type"><a href="namespace_webdriver_By.html">webdriver.By</a></code> namespace, or as a short-hand <code class="type"><a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a></code> object. For example, the following two statements are equivalent: <code><pre> var e1 = element.findElement(By.id('foo')); var e2 = element.findElement({id:'foo'}); </pre></code> <p>You may also provide a custom locator function, which takes as input this WebDriver instance and returns a <code class="type"><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code>, or a promise that will resolve to a WebElement. For example, to find the first visible link on a page, you could write: <code><pre> var link = element.findElement(firstVisibleLink); function firstVisibleLink(element) { var links = element.findElements(By.tagName('a')); return webdriver.promise.filter(links, function(link) { return links.isDisplayed(); }).then(function(visibleLinks) { return visibleLinks[0]; }); } </pre></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The locator strategy to use when searching for the element.</dl><tr><th>Returns<tr><td><dl>A WebElement that can be used to issue commands against the located element. If the element is not found, the element will be invalidated and all scheduled commands aborted.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1750">code &raquo;</a><span class="member"><a name="findElements">findElements</a> <span class="args">( locator )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to find all of the descendants of this element that match the given search criteria.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The locator strategy to use when searching for the elements.</dl><tr><th>Returns<tr><td><dl>A promise that will resolve to an array of WebElements.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1898">code &raquo;</a><span class="member"><a name="getAttribute">getAttribute</a> <span class="args">( attributeName )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to query for the value of the given attribute of the element. Will return the current value, even if it has been modified after the page has been loaded. More exactly, this method will return the value of the given attribute, unless that attribute is not present, in which case the value of the property with the same name is returned. If neither value is set, null is returned (for example, the "value" property of a textarea element). The "style" attribute is converted as best can be to a text representation with a trailing semi-colon. The following are deemed to be "boolean" attributes and will return either "true" or null: <p>async, autofocus, autoplay, checked, compact, complete, controls, declare, defaultchecked, defaultselected, defer, disabled, draggable, ended, formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, selected, spellcheck, truespeed, willvalidate <p>Finally, the following commonly mis-capitalized attribute/property names are evaluated as expected: <ul> <li>"class" <li>"readonly" </ul></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>attributeName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the attribute to query.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved with the attribute's value. The returned value will always be either a string or null.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1860">code &raquo;</a><span class="member"><a name="getCssValue">getCssValue</a> <span class="args">( cssStyleProperty )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Schedules a command to query for the computed style of the element represented by this instance. If the element inherits the named style from its parent, the parent will be queried for its value. Where possible, color values will be converted to their hex representation (e.g. #00ff00 instead of rgb(0, 255, 0)). <p/> <em>Warning:</em> the value returned will be as the browser interprets it, so it may be tricky to form a proper assertion.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>cssStyleProperty: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the CSS style property to look up.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved with the requested CSS value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1635">code &raquo;</a><span class="member"><a name="getDriver">getDriver</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The parent driver for this instance.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1646">code &raquo;</a><span class="member"><a name="getId">getId</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>&gt;</code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that resolves to this element's JSON representation as defined by the WebDriver wire protocol.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2035">code &raquo;</a><span class="member"><a name="getInnerHtml">getInnerHtml</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Schedules a command to retrieve the inner HTML of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with the element's inner HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1939">code &raquo;</a><span class="member"><a name="getLocation">getLocation</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to compute the location of this element in page space.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved to the element's location as a <code >{x:number, y:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2016">code &raquo;</a><span class="member"><a name="getOuterHtml">getOuterHtml</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Schedules a command to retrieve the outer HTML of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with the element's outer HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1926">code &raquo;</a><span class="member"><a name="getSize">getSize</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to compute the size of this element's bounding box, in pixels.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with the element's size as a <code >{width:number, height:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1838">code &raquo;</a><span class="member"><a name="getTagName">getTagName</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Schedules a command to query for the tag/node name of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with the element's tag name.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1912">code &raquo;</a><span class="member"><a name="getText">getText</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Get the visible (i.e. not hidden by CSS) innerText of this element, including sub-elements, without any leading or trailing whitespace.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with the element's visible text.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2004">code &raquo;</a><span class="member"><a name="isDisplayed">isDisplayed</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>&gt;</code></span></div><p>Schedules a command to test whether this element is currently displayed.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with whether this element is currently visible on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1734">code &raquo;</a><span class="member"><a name="isElementPresent">isElementPresent</a> <span class="args">( locator )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>&gt;</code></span></div><p>Schedules a command to test if there is at least one descendant of this element that matches the given search criteria.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The locator strategy to use when searching for the element.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved with whether an element could be located on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1952">code &raquo;</a><span class="member"><a name="isEnabled">isEnabled</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>&gt;</code></span></div><p>Schedules a command to query whether the DOM element represented by this instance is enabled, as dicted by the <code >disabled</code> attribute.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with whether this element is currently enabled.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1964">code &raquo;</a><span class="member"><a name="isSelected">isSelected</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>&gt;</code></span></div><p>Schedules a command to query whether this element is selected.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved with whether this element is currently selected.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1663">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="schedule_">schedule_</a> <span class="args">( command, description )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;T&gt;</code></span></div><p>Schedules a command that targets this element with the parent WebDriver instance. Will ensure this element's ID is included in the command parameters under the "id" key.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>command: <code class="type">!<a href="class_webdriver_Command.html">webdriver.Command</a></code><dd>The command to schedule.<dt>description: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>A description of the command for debugging.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved with the command result.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1816">code &raquo;</a><span class="member"><a name="sendKeys">sendKeys</a> <span class="args">( var_args )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;void&gt;</code></span></div><p>Schedules a command to type a sequence on the DOM element represented by this instance. <p/> Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is processed in the keysequence, that key state is toggled until one of the following occurs: <ul> <li>The modifier key is encountered again in the sequence. At this point the state of the key is toggled (along with the appropriate keyup/down events). </li> <li>The <code >webdriver.Key.NULL</code> key is encountered in the sequence. When this key is encountered, all modifier keys current in the down state are released (with accompanying keyup events). The NULL key can be used to simulate common keyboard shortcuts: <code><pre> element.sendKeys("text was", webdriver.Key.CONTROL, "a", webdriver.Key.NULL, "now text is"); // Alternatively: element.sendKeys("text was", webdriver.Key.chord(webdriver.Key.CONTROL, "a"), "now text is"); </pre></code></li> <li>The end of the keysequence is encountered. When there are no more keys to type, all depressed modifier keys are released (with accompanying keyup events). </li> </ul> <strong>Note:</strong> On browsers where native keyboard events are not yet supported (e.g. Firefox on OS X), key events will be synthesized. Special punctionation keys will be synthesized according to a standard QWERTY en-us keyboard layout.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The sequence of keys to type. All arguments will be joined into a single sequence (var_args is permitted for convenience).</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved when all keys have been typed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1978">code &raquo;</a><span class="member"><a name="submit">submit</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;void&gt;</code></span></div><p>Schedules a command to submit the form containing this element (or this element if it is a FORM element). This command is a no-op if the element is not contained in a form.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved when the form has been submitted.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1578">code &raquo;</a><span class="member"><a name="driver_">driver_</a> : <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1581">code &raquo;</a><span class="member"><a name="id_">id_</a> : <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>&gt;</code></span></div></summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1610">code &raquo;</a><span class="member"><a name="webdriver.WebElement.equals">webdriver.WebElement.equals</a> <span class="args">( a, b )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>&gt;</code></span></div><p>Compares to WebElements for equality.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>a: <code class="type">!<a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd>A WebElement.<dt>b: <code class="type">!<a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd>A WebElement.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved to whether the two WebElements are equal.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1600">code &raquo;</a><span class="member"><a name="webdriver.WebElement.ELEMENT_KEY">webdriver.WebElement.ELEMENT_KEY</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>The property key used in the wire protocol to indicate that a JSON object contains the ID of a WebElement.</summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>