gecko-dev/testing/marionette/doc/GeckoDriver.html

14475 строки
179 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: GeckoDriver</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: GeckoDriver</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>GeckoDriver<span class="signature">(appName, server)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="GeckoDriver"><span class="type-signature"></span>new GeckoDriver<span class="signature">(appName, server)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Implements (parts of) the W3C WebDriver protocol. GeckoDriver lives
in chrome space and mediates calls to the message listener of the current
browsing context's content frame message listener via ListenerProxy.</p>
<p>Throughout this prototype, functions with the argument <var>cmd</var>'s
documentation refers to the contents of the <code>cmd.parameter</code>
object.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>appName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Description of the product, for example &quot;Firefox&quot;.</p></td>
</tr>
<tr>
<td class="name"><code>server</code></td>
<td class="type">
<span class="param-type">MarionetteServer</span>
</td>
<td class="description last"><p>The instance of Marionette server.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line134">line 134</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="acceptConnections"><span class="type-signature"></span>acceptConnections<span class="signature">(state)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Enables or disables accepting new socket connections.</p>
<p>By calling this method with <code>false</code> the server will not accept any
further connections, but existing connections will not be forcible
closed. Use <code>true</code> to re-enable accepting connections.</p>
<p>Please note that when closing the connection via the client you can
end-up in a non-recoverable state if it hasn't been enabled before.</p>
<p>This method is used for custom in application shutdowns via
marionette.quit() or marionette.restart(), like File -&gt; Quit.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>True if the server should accept new socket connections.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3246">line 3246</a>
</li></ul></dd>
</dl>
<h4 class="name" id="acceptDialog"><span class="type-signature"></span>acceptDialog<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Accepts a currently displayed tab modal, or returns no such alert if
no modal is displayed.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3166">line 3166</a>
</li></ul></dd>
</dl>
<h4 class="name" id="actionChain"><span class="type-signature"></span>actionChain<span class="signature">(value)</span><span class="type-signature"> &rarr; {number}</span></h4>
<div class="description">
<p>An action chain.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A nested array where the inner array represents each event,
and the outer array represents a collection of events.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2023">line 2023</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not applicable to application.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Last touch ID.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
<h4 class="name" id="addBrowser"><span class="type-signature"></span>addBrowser<span class="signature">(win)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Create a new browsing context for window and add to known browsers.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>win</code></td>
<td class="type">
<span class="param-type">nsIDOMWindow</span>
</td>
<td class="description last"><p>Window for which we will create a browsing context.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line470">line 470</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns the unique server-assigned ID of the window.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="addCookie"><span class="type-signature"></span>addCookie<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Add a single cookie to the cookie store associated with the active
document's address.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>{Map.<string,</code></td>
<td class="type">
</td>
<td class="description last"><p>(string|number|boolean)&gt; cookie
Cookie object.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2646">line 2646</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If <var>cookie</var> is for a different domain than the active
document's host.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">InvalidCookieDomainError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="clearElement"><span class="type-signature"></span>clearElement<span class="signature">(id)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Clear the text of an element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be cleared.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2593">line 2593</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="clickElement"><span class="type-signature"></span>clickElement<span class="signature">(id)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Send click event to element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be clicked.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2202">line 2202</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="close"><span class="type-signature"></span>close<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
<div class="description">
<p>Close the currently selected tab/window.</p>
<p>With multiple open tabs present the currently selected tab will
be closed. Otherwise the window itself will be closed. If it is the
last window currently open, the window will not be closed to prevent
a shutdown of the application. Instead the returned list of window
handles is empty.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2752">line 2752</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique window handles of remaining windows.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;string></span>
</dd>
</dl>
<h4 class="name" id="closeChromeWindow"><span class="type-signature"></span>closeChromeWindow<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
<div class="description">
<p>Close the currently selected chrome window.</p>
<p>If it is the last window currently open, the chrome window will not be
closed to prevent a shutdown of the application. Instead the returned
list of chrome window handles is empty.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2793">line 2793</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique chrome window handles of remaining chrome windows.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;string></span>
</dd>
</dl>
<h4 class="name" id="deleteAllCookies"><span class="type-signature"></span>deleteAllCookies<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Delete all cookies that are visible to a document.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2698">line 2698</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="deleteCookie"><span class="type-signature"></span>deleteCookie<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Delete a cookie by name.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2719">line 2719</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="deleteSession"><span class="type-signature"></span>deleteSession<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Delete Marionette session.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2823">line 2823</a>
</li></ul></dd>
</dl>
<h4 class="name" id="dismissDialog"><span class="type-signature"></span>dismissDialog<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Dismisses a currently displayed tab modal, or returns no such alert if
no modal is displayed.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3153">line 3153</a>
</li></ul></dd>
</dl>
<h4 class="name" id="executeAsyncScript"><span class="type-signature"></span>executeAsyncScript<span class="signature">(script, args, scriptTimeout, sandbox<span class="signature-attributes">opt</span>, newSandbox<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>, line<span class="signature-attributes">opt</span>, debug_script<span class="signature-attributes">opt</span>, directInject<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string|boolean|number|object|WebElement}</span></h4>
<div class="description">
<p>Executes a JavaScript function in the context of the current browsing
context, if in content space, or in chrome space otherwise, and returns
the object passed to the callback.</p>
<p>The callback is always the last argument to the <var>arguments</var>
list passed to the function scope of the script. It can be retrieved
as such:</p>
<pre><code>
let callback = arguments[arguments.length - 1];
callback("foo");
// "foo" is returned
</code></pre>
<p>It is important to note that if the <var>sandboxName</var> parameter
is left undefined, the script will be evaluated in a mutable sandbox,
causing any change it makes on the global state of the document to have
lasting side-effects.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>script</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Script to evaluate as a function body.</p></td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Array.&lt;(string|boolean|number|object|WebElement)></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Arguments exposed to the script in <code>arguments</code>.
The array items must be serialisable to the WebDriver protocol.</p></td>
</tr>
<tr>
<td class="name"><code>scriptTimeout</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Duration in milliseconds of when to interrupt and abort the
script evaluation.</p></td>
</tr>
<tr>
<td class="name"><code>sandbox</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Name of the sandbox to evaluate the script in. The sandbox is
cached for later re-use on the same Window object if
<var>newSandbox</var> is false. If the parameter is undefined,
the script is evaluated in a mutable sandbox. If the parameter
is &quot;system&quot;, it will be evaluted in a sandbox with elevated system
privileges, equivalent to chrome space.</p></td>
</tr>
<tr>
<td class="name"><code>newSandbox</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Forces the script to be evaluated in a fresh sandbox. Note that if
it is undefined, the script will normally be evaluted in a fresh
sandbox.</p></td>
</tr>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Filename of the client's program where this script is evaluated.</p></td>
</tr>
<tr>
<td class="name"><code>line</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Line in the client's program where this script is evaluated.</p></td>
</tr>
<tr>
<td class="name"><code>debug_script</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Attach an <code>onerror</code> event handler on the <code>Window</code>
object. It does not differentiate content errors from chrome errors.</p></td>
</tr>
<tr>
<td class="name"><code>directInject</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Evaluate the script without wrapping it in a function.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1024">line 1024</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the script was interrupted due to reaching the
<var>scriptTimeout</var> or default timeout.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">ScriptTimeoutError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If an Error was thrown whilst evaluating the script.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="JavaScriptError.html">JavaScriptError</a></span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Return value from the script, or null which signifies either the
JavaScript notion of null or undefined.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
|
<span class="param-type">boolean</span>
|
<span class="param-type">number</span>
|
<span class="param-type">object</span>
|
<span class="param-type">WebElement</span>
</dd>
</dl>
<h4 class="name" id="executeScript"><span class="type-signature"></span>executeScript<span class="signature">(script, args, scriptTimeout, sandbox<span class="signature-attributes">opt</span>, newSandbox<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>, line<span class="signature-attributes">opt</span>, debug_script<span class="signature-attributes">opt</span>, directInject<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string|boolean|number|object|WebElement}</span></h4>
<div class="description">
<p>Executes a JavaScript function in the context of the current browsing
context, if in content space, or in chrome space otherwise, and returns
the return value of the function.</p>
<p>It is important to note that if the <var>sandboxName</var> parameter
is left undefined, the script will be evaluated in a mutable sandbox,
causing any change it makes on the global state of the document to have
lasting side-effects.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>script</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Script to evaluate as a function body.</p></td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Array.&lt;(string|boolean|number|object|WebElement)></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Arguments exposed to the script in <code>arguments</code>.
The array items must be serialisable to the WebDriver protocol.</p></td>
</tr>
<tr>
<td class="name"><code>scriptTimeout</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Duration in milliseconds of when to interrupt and abort the
script evaluation.</p></td>
</tr>
<tr>
<td class="name"><code>sandbox</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Name of the sandbox to evaluate the script in. The sandbox is
cached for later re-use on the same Window object if
<var>newSandbox</var> is false. If he parameter is undefined,
the script is evaluated in a mutable sandbox. If the parameter
is &quot;system&quot;, it will be evaluted in a sandbox with elevated system
privileges, equivalent to chrome space.</p></td>
</tr>
<tr>
<td class="name"><code>newSandbox</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Forces the script to be evaluated in a fresh sandbox. Note that if
it is undefined, the script will normally be evaluted in a fresh
sandbox.</p></td>
</tr>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Filename of the client's program where this script is evaluated.</p></td>
</tr>
<tr>
<td class="name"><code>line</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Line in the client's program where this script is evaluated.</p></td>
</tr>
<tr>
<td class="name"><code>debug_script</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Attach an <code>onerror</code> event handler on the <code>Window</code>
object. It does not differentiate content errors from chrome errors.</p></td>
</tr>
<tr>
<td class="name"><code>directInject</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Evaluate the script without wrapping it in a function.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line947">line 947</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the script was interrupted due to reaching the
<var>scriptTimeout</var> or default timeout.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">ScriptTimeoutError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If an <code>Error</code> was thrown whilst evaluating the script.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="JavaScriptError.html">JavaScriptError</a></span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Return value from the script, or null which signifies either the
JavaScript notion of null or undefined.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
|
<span class="param-type">boolean</span>
|
<span class="param-type">number</span>
|
<span class="param-type">object</span>
|
<span class="param-type">WebElement</span>
</dd>
</dl>
<h4 class="name" id="findElement"><span class="type-signature"></span>findElement<span class="signature">(using, value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Find an element using the indicated search strategy.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>using</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Indicates which search method to use.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Value the client is looking for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2085">line 2085</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="findElements"><span class="type-signature"></span>findElements<span class="signature">(using, value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Find elements using the indicated search strategy.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>using</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Indicates which search method to use.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Value the client is looking for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2132">line 2132</a>
</li></ul></dd>
</dl>
<h4 class="name" id="findWindow"><span class="type-signature"></span>findWindow<span class="signature">(winIterable, filter)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Find a specific window according to some filter function.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>winIterable</code></td>
<td class="type">
<span class="param-type">Iterable.&lt;Window></span>
</td>
<td class="description last"><p>Iterable that emits Windows.</p></td>
</tr>
<tr>
<td class="name"><code>filter</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>A callback function taking two arguments; the window and
the outerId of the window, and returning a boolean indicating
whether the window is the target.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1621">line 1621</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A window handle object containing the window and some
associated metadata.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="fullscreen"><span class="type-signature"></span>fullscreen<span class="signature">()</span><span class="type-signature"> &rarr; {Map.&lt;string, number>}</span></h4>
<div class="description">
<p>Synchronously sets the user agent window to full screen as if the user
had done &quot;View &gt; Enter Full Screen&quot;, or restores it if it is already
in full screen.</p>
<p>Not supported on Fennec.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3136">line 3136</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available for current application.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Window rect.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Map.&lt;string, number></span>
</dd>
</dl>
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(url)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Navigate to given URL.</p>
<p>Navigates the current browsing context to the given URL and waits for
the document to load or the session's page timeout duration to elapse
before returning.</p>
<p>The command will return with a failure if there is an error loading
the document or the URL is blocked. This can occur if it fails to
reach host, the URL is malformed, or if there is a certificate issue
to name some examples.</p>
<p>The document is considered successfully loaded when the
DOMContentLoaded event on the frame element associated with the
current window triggers and document.readyState is &quot;complete&quot;.</p>
<p>In chrome context it will change the current window's location to
the supplied URL and wait until document.readyState equals &quot;complete&quot;
or the page timeout duration has elapsed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL to navigate to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1106">line 1106</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="getActiveElement"><span class="type-signature"></span>getActiveElement<span class="signature">()</span><span class="type-signature"> &rarr; {WebElement}</span></h4>
<div class="description">
<p>Return the active element on the page.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2183">line 2183</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Active element of the current browsing context's document element.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">WebElement</span>
</dd>
</dl>
<h4 class="name" id="getChromeWindowHandle"><span class="type-signature"></span>getChromeWindowHandle<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Get the current window's handle. This corresponds to a window that
may itself contain tabs.</p>
<p>Return an opaque server-assigned identifier to this window that
uniquely identifies it within this Marionette instance. This can
be used to switch to this window at a later point.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1412">line 1412</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique window handle.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getChromeWindowHandles"><span class="type-signature"></span>getChromeWindowHandles<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
<div class="description">
<p>Returns identifiers for each open chrome window for tests interested in
managing a set of chrome windows and tabs separately.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1430">line 1430</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique window handles.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;string></span>
</dd>
</dl>
<h4 class="name" id="getContext"><span class="type-signature"></span>getContext<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Gets the context of the server, either &quot;chrome&quot; or &quot;content&quot;.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line894">line 894</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getCookies"><span class="type-signature"></span>getCookies<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get all the cookies for the current domain.</p>
<p>This is the equivalent of calling <code>document.cookie</code> and
parsing the result.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2679">line 2679</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="getCurrentUrl"><span class="type-signature"></span>getCurrentUrl<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get a string representing the current URL.</p>
<p>On Desktop this returns a string representation of the URL of the
current top level browsing context. This is equivalent to
document.location.href.</p>
<p>When in the context of the chrome, this returns the canonical URL
of the current resource.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1150">line 1150</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="getCurrentWindow"><span class="type-signature"></span>getCurrentWindow<span class="signature">(forcedContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {ChromeWindow}</span></h4>
<div class="description">
<p>Get the session's current top-level browsing context.</p>
<p>It will return the outer <code>ChromeWindow</code> previously selected by
window handle through <code>#switchToWindow</code>, or the first window that
was registered.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>forcedContext</code></td>
<td class="type">
<span class="param-type">Context</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional name of the context to use for finding the window.
It will be required if a command always needs a specific context,
whether which context is currently set. Defaults to the current
context.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line416">line 416</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The current top-level browsing context.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">ChromeWindow</span>
</dd>
</dl>
<h4 class="name" id="getElementAttribute"><span class="type-signature"></span>getElementAttribute<span class="signature">(id, name)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Get a given attribute of an element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Web element reference ID to the element that will be inspected.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Name of the attribute which value to retrieve.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2261">line 2261</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Value of the attribute.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getElementProperty"><span class="type-signature"></span>getElementProperty<span class="signature">(id, name)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Returns the value of a property associated with given element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Web element reference ID to the element that will be inspected.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Name of the property which value to retrieve.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2295">line 2295</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Value of the property.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getElementRect"><span class="type-signature"></span>getElementRect<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2525">line 2525</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="getElementTagName"><span class="type-signature"></span>getElementTagName<span class="signature">(id)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Get the tag name of the element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be inspected.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2363">line 2363</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Local tag name of element.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getElementText"><span class="type-signature"></span>getElementText<span class="signature">(id)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Get the text of an element, if any. Includes the text of all child
elements.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be inspected.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2328">line 2328</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Element's text &quot;as rendered&quot;.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getElementValueOfCssProperty"><span class="type-signature"></span>getElementValueOfCssProperty<span class="signature">(id, propertyName)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Return the property of the computed style of an element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be checked.</p></td>
</tr>
<tr>
<td class="name"><code>propertyName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>CSS rule that is being requested.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2430">line 2430</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Value of |propertyName|.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getPageSource"><span class="type-signature"></span>getPageSource<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Gets the page source of the content document.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1194">line 1194</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>String serialisation of the DOM of the current browsing context's
active document.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getScreenOrientation"><span class="type-signature"></span>getScreenOrientation<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get the current browser orientation.</p>
<p>Will return one of the valid primary orientation values
portrait-primary, landscape-primary, portrait-secondary, or
landscape-secondary.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2965">line 2965</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getSessionCapabilities"><span class="type-signature"></span>getSessionCapabilities<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Send the current session's capabilities to the client.</p>
<p>Capabilities informs the client of which WebDriver features are
supported by Firefox and Marionette. They are immutable for the
length of the session.</p>
<p>The return value is an immutable map of string keys
(&quot;capabilities&quot;) to values, which may be of types boolean,
numerical or string.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line872">line 872</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getTextFromDialog"><span class="type-signature"></span>getTextFromDialog<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Returns the message shown in a currently displayed modal, or returns
a no such alert error if no modal is currently displayed.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3179">line 3179</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getTitle"><span class="type-signature"></span>getTitle<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Gets the current title of the window.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1168">line 1168</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Document title of the top-level browsing context.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getVisibleText"><span class="type-signature"></span>getVisibleText<span class="signature">(el, lines)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Recursively get all labeled text.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>el</code></td>
<td class="type">
<span class="param-type">nsIDOMElement</span>
</td>
<td class="description last"><p>The parent element.</p></td>
</tr>
<tr>
<td class="name"><code>lines</code></td>
<td class="type">
<span class="param-type">Array.&lt;string></span>
</td>
<td class="description last"><p>Array that holds the text lines.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line555">line 555</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getWindowHandle"><span class="type-signature"></span>getWindowHandle<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Get the current window's handle. On desktop this typically corresponds
to the currently selected tab.</p>
<p>Return an opaque server-assigned identifier to this window that
uniquely identifies it within this Marionette instance. This can
be used to switch to this window at a later point.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1377">line 1377</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique window handle.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getWindowHandles"><span class="type-signature"></span>getWindowHandles<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
<div class="description">
<p>Get a list of top-level browsing contexts. On desktop this typically
corresponds to the set of open tabs for browser windows, or the window
itself for non-browser chrome windows.</p>
<p>Each window handle is assigned by the server and is guaranteed unique,
however the return array does not have a specified ordering.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1394">line 1394</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Unique window handles.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;string></span>
</dd>
</dl>
<h4 class="name" id="getWindowRect"><span class="type-signature"></span>getWindowRect<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, number>}</span></h4>
<div class="description">
<p>Get the current position and size of the browser window currently in focus.</p>
<p>Will return the current browser window size in pixels. Refers to
window outerWidth and outerHeight values, which include scroll bars,
title bars, etc.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1450">line 1450</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Object with |x| and |y| coordinates, and |width| and |height|
of browser window.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object.&lt;string, number></span>
</dd>
</dl>
<h4 class="name" id="getWindowType"><span class="type-signature"></span>getWindowType<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Gets the current type of the window.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1176">line 1176</a>
</li></ul></dd>
</dl>
<h4 class="name" id="globalModalDialogHandler"><span class="type-signature"></span>globalModalDialogHandler<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Callback used to observe the creation of new modal or tab modal dialogs
during the session's lifetime.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line310">line 310</a>
</li></ul></dd>
</dl>
<h4 class="name" id="goBack"><span class="type-signature"></span>goBack<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Cause the browser to traverse one step backward in the joint history
of the current browsing context.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1221">line 1221</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="goForward"><span class="type-signature"></span>goForward<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Cause the browser to traverse one step forward in the joint history
of the current browsing context.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1264">line 1264</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="isElementDisplayed"><span class="type-signature"></span>isElementDisplayed<span class="signature">(id)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
<p>Check if element is displayed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be inspected.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2395">line 2395</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if displayed, false otherwise.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="isElementEnabled"><span class="type-signature"></span>isElementEnabled<span class="signature">(id)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
<p>Check if element is enabled.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be checked.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2465">line 2465</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if enabled, false if disabled.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="isElementSelected"><span class="type-signature"></span>isElementSelected<span class="signature">(id)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
<p>Check if element is selected.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be checked.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2499">line 2499</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if selected, false if unselected.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="localizeEntity"><span class="type-signature"></span>localizeEntity<span class="signature">(urls, id)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Retrieve the localized string for the specified entity id.</p>
<p>Example:
localizeEntity([&quot;chrome://global/locale/about.dtd&quot;], &quot;about.version&quot;)</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>urls</code></td>
<td class="type">
<span class="param-type">Array.&lt;string></span>
</td>
<td class="description last"><p>Array of .dtd URLs.</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The ID of the entity to retrieve the localized string for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3434">line 3434</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The localized string for the requested entity.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="localizeProperty"><span class="type-signature"></span>localizeProperty<span class="signature">(urls, id)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Retrieve the localized string for the specified property id.</p>
<p>Example:</p>
<pre class="prettyprint source"><code>localizeProperty(
[&quot;chrome://global/locale/findbar.properties&quot;], &quot;FastFind&quot;);</code></pre>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>urls</code></td>
<td class="type">
<span class="param-type">Array.&lt;string></span>
</td>
<td class="description last"><p>Array of .properties URLs.</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The ID of the property to retrieve the localized string for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3463">line 3463</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The localized string for the requested property.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="maximizeWindow"><span class="type-signature"></span>maximizeWindow<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, number>}</span></h4>
<div class="description">
<p>Synchronously maximizes the user agent window as if the user pressed
the maximize button, or restores it if it is already maximized.</p>
<p>Not supported on Fennec.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3055">line 3055</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available for current application.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Window rect.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object.&lt;string, number></span>
</dd>
</dl>
<h4 class="name" id="minimizeWindow"><span class="type-signature"></span>minimizeWindow<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, number>}</span></h4>
<div class="description">
<p>Synchronously minimizes the user agent window as if the user pressed
the minimize button, or restores it if it is already minimized.</p>
<p>Not supported on Fennec.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3021">line 3021</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available for current application.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Window rect and window state.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object.&lt;string, number></span>
</dd>
</dl>
<h4 class="name" id="multiAction"><span class="type-signature"></span>multiAction<span class="signature">(value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>A multi-action chain.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A nested array where the inner array represents eache vent,
the middle array represents a collection of events for each
finger, and the outer array represents all fingers.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2061">line 2061</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="newSession"><span class="type-signature"></span>newSession<span class="signature">(sessionId<span class="signature-attributes">opt</span>, capabilities<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Create a new WebDriver session.</p>
<p>It is expected that the caller performs the necessary checks on
the requested capabilities to be WebDriver conforming. The WebDriver
service offered by Marionette does not match or negotiate capabilities
beyond type- and bounds checks.</p>
<h3>Capabilities</h3>
<dl>
<dt><code>pageLoadStrategy</code> (string)
<dd>The page load strategy to use for the current session. Must be
one of &quot;<tt>none</tt>&quot;, &quot;<tt>eager</tt>&quot;, and &quot;<tt>normal</tt>&quot;.
<dt><code>acceptInsecureCerts</code> (boolean)
<dd>Indicates whether untrusted and self-signed TLS certificates
are implicitly trusted on navigation for the duration of the session.
<dt><code>timeouts</code> (Timeouts object)
<dd>Describes the timeouts imposed on certian session operations.
<dt><code>proxy</code> (Proxy object)
<dd>Defines the proxy configuration.
<dt><code>specificationLevel</code> (number)
<dd>If set to 1, a WebDriver conforming <i>WebDriver::ElementClick</i>
implementation will be used.
<dt><code>moz:accessibilityChecks</code> (boolean)
<dd>Run a11y checks when clicking elements.
</dl>
<h4>Timeouts object</h4>
<dl>
<dt><code>script</code> (number)
<dd>Determines when to interrupt a script that is being evaluates.
<dt><code>pageLoad</code> (number)
<dd>Provides the timeout limit used to interrupt navigation of the
browsing context.
<dt><code>implicit</code> (number)
<dd>Gives the timeout of when to abort when locating an element.
</dl>
<h4>Proxy object</h4>
<dl>
<dt><code>proxyType</code> (string)
<dd>Indicates the type of proxy configuration. Must be one
of &quot;<tt>pac</tt>&quot;, &quot;<tt>direct</tt>&quot;, &quot;<tt>autodetect</tt>&quot;,
&quot;<tt>system</tt>&quot;, or &quot;<tt>manual</tt>&quot;.
<dt><code>proxyAutoconfigUrl</code> (string)
<dd>Defines the URL for a proxy auto-config file if
<code>proxyType</code> is equal to &quot;<tt>pac</tt>&quot;.
<dt><code>ftpProxy</code> (string)
<dd>Defines the proxy host for FTP traffic when the
<code>proxyType</code> is &quot;<tt>manual</tt>&quot;.
<dt><code>httpProxy</code> (string)
<dd>Defines the proxy host for HTTP traffic when the
<code>proxyType</code> is &quot;<tt>manual</tt>&quot;.
<dt><code>noProxy</code> (string)
<dd>Lists the adress for which the proxy should be bypassed when
the <code>proxyType</code> is &quot;<tt>manual</tt>&quot;. Must be a JSON
List containing any number of any of domains, IPv4 addresses, or IPv6
addresses.
<dt><code>sslProxy</code> (string)
<dd>Defines the proxy host for encrypted TLS traffic when the
<code>proxyType</code> is &quot;<tt>manual</tt>&quot;.
<dt><code>socksProxy</code> (string)
<dd>Defines the proxy host for a SOCKS proxy traffic when the
<code>proxyType</code> is &quot;<tt>manual</tt>&quot;.
<dt><code>socksVersion</code> (string)
<dd>Defines the SOCKS proxy version when the <code>proxyType</code> is
&quot;<tt>manual</tt>&quot;. It must be any integer between 0 and 255
inclusive.
</dl>
<h3>Example</h3>
<p>Input:</p>
<pre><code>
{"capabilities": {"acceptInsecureCerts": true}}
</code></pre>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>sessionId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Normally a unique ID is given to a new session, however this can
be overriden by providing this field.</p></td>
</tr>
<tr>
<td class="name"><code>capabilities</code></td>
<td class="type">
<span class="param-type">Object.&lt;string, *></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>JSON Object containing any of the recognised capabilities listed
above.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line770">line 770</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If, for whatever reason, a session could not be created.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">SessionNotCreatedError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Session ID and capabilities offered by the WebDriver service.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="performActions"><span class="type-signature"></span>performActions<span class="signature">(actions)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Perform a series of grouped actions at the specified points in time.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>actions</code></td>
<td class="type">
<span class="param-type">Array.&lt;?></span>
</td>
<td class="description last"><p>Array of objects that each represent an action sequence.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1978">line 1978</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not yet available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="quit"><span class="type-signature"></span>quit<span class="signature">(flags<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Quits the application with the provided flags.</p>
<p>Marionette will stop accepting new connections before ending the
current session, and finally attempting to quit the application.</p>
<p>Optional <code>nsIAppStartup</code> flags may be provided as
an array of masks, and these will be combined by ORing
them with a bitmask. The available masks are defined in
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAppStartup.</p>
<p>Crucially, only one of the <em>Quit flags can be specified. The |eRestart|
flag may be bit-wise combined with one of the </em>Quit flags to cause
the application to restart after it quits.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>flags</code></td>
<td class="type">
<span class="param-type">Array.&lt;string></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Constant name of masks to pass to |Services.startup.quit|.
If empty or undefined, |nsIAppStartup.eAttemptQuit| is used.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3279">line 3279</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If <var>flags</var> contains unknown or incompatible flags,
for example multiple Quit flags.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="InvalidArgumentError.html">InvalidArgumentError</a></span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Explaining the reason why the application quit. This can be
in response to a normal shutdown or restart, yielding &quot;shutdown&quot;
or &quot;restart&quot;, respectively.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="refresh"><span class="type-signature"></span>refresh<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Causes the browser to reload the page in current top-level browsing
context.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1308">line 1308</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="registerBrowser"><span class="type-signature"></span>registerBrowser<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Handles registration of new content listener browsers. Depending on
their type they are either accepted or ignored.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line576">line 576</a>
</li></ul></dd>
</dl>
<h4 class="name" id="releaseActions"><span class="type-signature"></span>releaseActions<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Release all the keys and pointer buttons that are currently depressed.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1998">line 1998</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not available in current context.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="runReftest"><span class="type-signature"></span>runReftest<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Run a reftest.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3502">line 3502</a>
</li></ul></dd>
</dl>
<h4 class="name" id="sendAsync"><span class="type-signature"></span>sendAsync<span class="signature">(name, msg<span class="signature-attributes">opt</span>, commandID<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Helper method to send async messages to the content listener.
Correct usage is to pass in the name of a function in listener.js,
a serialisable object, and optionally the current command's ID
when not using the modern dispatching technique.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Suffix of the targetted message listener
<tt>Marionette:SUFFIX</tt>.</p></td>
</tr>
<tr>
<td class="name"><code>msg</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional JSON serialisable object to send to the listener.</p></td>
</tr>
<tr>
<td class="name"><code>commandID</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional command ID to ensure synchronisity.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line351">line 351</a>
</li></ul></dd>
</dl>
<h4 class="name" id="sendKeysToDialog"><span class="type-signature"></span>sendKeysToDialog<span class="signature">(text)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Set the user prompt's value field.</p>
<p>Sends keys to the input field of a currently displayed modal, or
returns a no such alert error if no modal is currently displayed. If
a tab modal is currently displayed but has no means for text input,
an element not visible error is returned.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>text</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Input to the user prompt's value field.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3206">line 3206</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the current user prompt is an alert or confirm.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="ElementNotInteractableError.html">ElementNotInteractableError</a></span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If there is no current user prompt.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchAlertError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the current user prompt is something other than an alert,
confirm, or a prompt.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="sendKeysToElement"><span class="type-signature"></span>sendKeysToElement<span class="signature">(id, value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Send key presses to element after focusing on it.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Reference ID to the element that will be checked.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Value to send to the element.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2562">line 2562</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="setContext"><span class="type-signature"></span>setContext<span class="signature">(value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sets the context of the subsequent commands to be either &quot;chrome&quot; or
&quot;content&quot;.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Name of the context to be switched to. Must be one of &quot;chrome&quot; or
&quot;content&quot;.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line884">line 884</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setScreenOrientation"><span class="type-signature"></span>setScreenOrientation<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Set the current browser orientation.</p>
<p>The supplied orientation should be given as one of the valid
orientation values. If the orientation is unknown, an error will
be raised.</p>
<p>Valid orientations are &quot;portrait&quot; and &quot;landscape&quot;, which fall
back to &quot;portrait-primary&quot; and &quot;landscape-primary&quot; respectively,
and &quot;portrait-secondary&quot; as well as &quot;landscape-secondary&quot;.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2983">line 2983</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setTimeouts"><span class="type-signature"></span>setTimeouts<span class="signature">(Dictionary)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Set timeout for page loading, searching, and scripts.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>Dictionary</code></td>
<td class="type">
<span class="param-type">Object.&lt;string, number></span>
</td>
<td class="description last"><p>of timeout types and their new value, where all timeout
types are optional.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1941">line 1941</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If timeout type key is unknown, or the value provided with it is
not an integer.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="InvalidArgumentError.html">InvalidArgumentError</a></span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h4 class="name" id="setupReftest"><span class="type-signature"></span>setupReftest<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Initialize the reftest mode</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3479">line 3479</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setWindowHandle"><span class="type-signature"></span>setWindowHandle<span class="signature">(winProperties, focus<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Switch the marionette window to a given window. If the browser in
the window is unregistered, registers that browser and waits for
the registration is complete. If |focus| is true then set the focus
on the window.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>winProperties</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Object containing window properties such as returned from
GeckoDriver#findWindow</p></td>
</tr>
<tr>
<td class="name"><code>focus</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>A boolean value which determines whether to focus the window.
Defaults to true.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1665">line 1665</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setWindowRect"><span class="type-signature"></span>setWindowRect<span class="signature">(x, y, width, height)</span><span class="type-signature"> &rarr; {Object.&lt;string, number>}</span></h4>
<div class="description">
<p>Set the window position and size of the browser on the operating
system window manager.</p>
<p>The supplied |width| and |height| values refer to the window outerWidth
and outerHeight values, which include browser chrome and OS-level
window borders.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>X coordinate of the top/left of the window that it will be
moved to.</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Y coordinate of the top/left of the window that it will be
moved to.</p></td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Width to resize the window to.</p></td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Height to resize the window to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1486">line 1486</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Not applicable to application.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnsupportedOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Object with |x| and |y| coordinates and |width| and |height|
dimensions.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object.&lt;string, number></span>
</dd>
</dl>
<h4 class="name" id="singleTap"><span class="type-signature"></span>singleTap<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Single tap.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1948">line 1948</a>
</li></ul></dd>
</dl>
<h4 class="name" id="startBrowser"><span class="type-signature"></span>startBrowser<span class="signature">(win, false<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Registers a new browser, win, with Marionette.</p>
<p>If we have not seen the browser content window before, the listener
frame script will be loaded into it. If isNewSession is true, we will
switch focus to the start frame when it registers.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>win</code></td>
<td class="type">
<span class="param-type">nsIDOMWindow</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Window whose browser we need to access.</p></td>
</tr>
<tr>
<td class="name"><code>false</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>isNewSession
True if this is the first time we're talking to this browser.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line495">line 495</a>
</li></ul></dd>
</dl>
<h4 class="name" id="switchToFrame"><span class="type-signature"></span>switchToFrame<span class="signature">(element, id)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Switch to a given frame within the current window.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>element</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A web element reference to the element to switch to.</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="description last"><p>If element is not defined, then this holds either the id, name,
or index of the frame to switch to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1751">line 1751</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="switchToGlobalMessageManager"><span class="type-signature"></span>switchToGlobalMessageManager<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Switches to the global ChromeMessageBroadcaster, potentially replacing
a frame-specific ChromeMessageSender. Has no effect if the global
ChromeMessageBroadcaster is already in use. If this replaces a
frame-specific ChromeMessageSender, it removes the message listeners
from that sender, and then puts the corresponding frame script &quot;to
sleep&quot;, which removes most of the message listeners from it as well.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line327">line 327</a>
</li></ul></dd>
</dl>
<h4 class="name" id="switchToParentFrame"><span class="type-signature"></span>switchToParentFrame<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Set the current browsing context for future commands to the parent
of the current browsing context.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1730">line 1730</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>Top-level browsing context has been discarded.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">NoSuchWindowError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>A modal dialog is open, blocking this operation.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">UnexpectedAlertOpenError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="switchToShadowRoot"><span class="type-signature"></span>switchToShadowRoot<span class="signature">(id)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Switch to shadow root of the given host element.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>element id.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2621">line 2621</a>
</li></ul></dd>
</dl>
<h4 class="name" id="switchToWindow"><span class="type-signature"></span>switchToWindow<span class="signature">(name, focus<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Switch current top-level browsing context by name or server-assigned
ID. Searches for windows by name, then ID. Content windows take
precedence.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Target name or ID of the window to switch to.</p></td>
</tr>
<tr>
<td class="name"><code>focus</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>A boolean value which determines whether to focus
the window. Defaults to true.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1581">line 1581</a>
</li></ul></dd>
</dl>
<h4 class="name" id="takeScreenshot"><span class="type-signature"></span>takeScreenshot<span class="signature">(id<span class="signature-attributes">opt</span>, highlights<span class="signature-attributes">opt</span>, full, hash<span class="signature-attributes">opt</span>, scroll<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
<div class="description">
<p>Takes a screenshot of a web element, current frame, or viewport.</p>
<p>The screen capture is returned as a lossless PNG image encoded as
a base 64 string.</p>
<p>If called in the content context, the |id| argument is not null and
refers to a present and visible web element's ID, the capture area will
be limited to the bounding box of that element. Otherwise, the capture
area will be the bounding box of the current frame.</p>
<p>If called in the chrome context, the screenshot will always represent
the entire viewport.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional web element reference to take a screenshot of.
If undefined, a screenshot will be taken of the document element.</p></td>
</tr>
<tr>
<td class="name"><code>highlights</code></td>
<td class="type">
<span class="param-type">Array.&lt;string></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>List of web elements to highlight.</p></td>
</tr>
<tr>
<td class="name"><code>full</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>True to take a screenshot of the entire document element. Is not
considered if <var>id</var> is not defined. Defaults to true.</p></td>
</tr>
<tr>
<td class="name"><code>hash</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>True if the user requests a hash of the image data.</p></td>
</tr>
<tr>
<td class="name"><code>scroll</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Scroll to element if |id| is provided. If undefined, it will
scroll to the element.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line2911">line 2911</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>If <var>hash</var> is false, PNG image encoded as Base64 encoded
string. If <var>hash</var> is true, hex digest of the SHA-256
hash of the Base64 encoded string.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="teardownReftest"><span class="type-signature"></span>teardownReftest<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>End a reftest run.</p>
<p>Closes the reftest window (without changing the current window handle),
and removes cached canvases.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line3524">line 3524</a>
</li></ul></dd>
</dl>
<h4 class="name" id="updateIdForBrowser"><span class="type-signature"></span>updateIdForBrowser<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Forces an update for the given browser's id.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line1337">line 1337</a>
</li></ul></dd>
</dl>
<h4 class="name" id="whenBrowserStarted"><span class="type-signature"></span>whenBrowserStarted<span class="signature">(win, isNewSession)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Callback invoked after a new session has been started in a browser.
Loads the Marionette frame script into the browser if needed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>win</code></td>
<td class="type">
<span class="param-type">nsIDOMWindow</span>
</td>
<td class="description last"><p>Window whose browser we need to access.</p></td>
</tr>
<tr>
<td class="name"><code>isNewSession</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>True if this is the first time we're talking to this browser.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="driver.js.html">driver.js</a>, <a href="driver.js.html#line512">line 512</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="accessibility.Checks.html">Checks</a></li><li><a href="action.Action.html">Action</a></li><li><a href="action.html#.Chain">Chain</a></li><li><a href="action.InputState.Key.html">Key</a></li><li><a href="action.InputState.Null.html">Null</a></li><li><a href="action.InputState.Pointer.html">Pointer</a></li><li><a href="action.Key.html">Key</a></li><li><a href="action.Mouse.html">Mouse</a></li><li><a href="action.PointerParameters.html">PointerParameters</a></li><li><a href="action.Sequence.html">Sequence</a></li><li><a href="AsyncChromeSender.html">AsyncChromeSender</a></li><li><a href="browser.Context.html">Context</a></li><li><a href="browser.Windows.html">Windows</a></li><li><a href="Command.html">Command</a></li><li><a href="DebuggerTransport.html">DebuggerTransport</a></li><li><a href="element.Store.html">Store</a></li><li><a href="ElementClickInterceptedError.html">ElementClickInterceptedError</a></li><li><a href="ElementNotAccessibleError.html">ElementNotAccessibleError</a></li><li><a href="ElementNotInteractableError.html">ElementNotInteractableError</a></li><li><a href="evaluate.this.Sandboxes.html">this.Sandboxes</a></li><li><a href="frame.Manager.html">Manager</a></li><li><a href="GeckoDriver.html">GeckoDriver</a></li><li><a href="InputState.html">InputState</a></li><li><a href="InsecureCertificateError.html">InsecureCertificateError</a></li><li><a href="InvalidArgumentError.html">InvalidArgumentError</a></li><li><a href="JavaScriptError.html">JavaScriptError</a></li><li><a href="Message.html">Message</a></li><li><a href="modal.Dialog.html">Dialog</a></li><li><a href="Packet.html">Packet</a></li><li><a href="proxy.AsyncMessageChannel.html">AsyncMessageChannel</a></li><li><a href="proxy.SyncChromeSender.html">SyncChromeSender</a></li><li><a href="reftest.Runner.html">Runner</a></li><li><a href="Response.html">Response</a></li><li><a href="server.TCPConnection.html">TCPConnection</a></li><li><a href="server.TCPListener.html">TCPListener</a></li><li><a href="session.Capabilities.html">Capabilities</a></li><li><a href="session.Proxy.html">Proxy</a></li><li><a href="session.Timeouts.html">Timeouts</a></li><li><a href="StreamCopier.html">StreamCopier</a></li><li><a href="WebDriverError.html">WebDriverError</a></li></ul><h3>Namespaces</h3><ul><li><a href="accessibility.html">accessibility</a></li><li><a href="action.html">action</a></li><li><a href="addon.html">addon</a></li><li><a href="assert.html">assert</a></li><li><a href="atom.html">atom</a></li><li><a href="browser.html">browser</a></li><li><a href="capture.html">capture</a></li><li><a href="cert.html">cert</a></li><li><a href="cookie.html">cookie</a></li><li><a href="driver.html">driver</a></li><li><a href="element.html">element</a></li><li><a href="error.html">error</a></li><li><a href="evaluate.html">evaluate</a></li><li><a href="global.html#event">event</a></li><li><a href="frame.html">frame</a></li><li><a href="interaction.html">interaction</a></li><li><a href="l10n.html">l10n</a></li><li><a href="legacyaction.html">legacyaction</a></li><li><a href="modal.html">modal</a></li><li><a href="navigate.html">navigate</a></li><li><a href="proxy.html">proxy</a></li><li><a href="reftest.html">reftest</a></li><li><a href="server.html">server</a></li><li><a href="session.html">session</a></li><li><a href="wait.html">wait</a></li></ul><h3>Global</h3><ul><li><a href="global.html#actionChain">actionChain</a></li><li><a href="global.html#addMessageListenerId">addMessageListenerId</a></li><li><a href="global.html#BulkPacket">BulkPacket</a></li><li><a href="global.html#cancelRequest">cancelRequest</a></li><li><a href="global.html#CHECKED_PROPERTY_SUPPORTED_XUL">CHECKED_PROPERTY_SUPPORTED_XUL</a></li><li><a href="global.html#checkExpectedEvent_">checkExpectedEvent_</a></li><li><a href="global.html#ChildDebuggerTransport">ChildDebuggerTransport</a></li><li><a href="global.html#clearElement">clearElement</a></li><li><a href="global.html#clickElement">clickElement</a></li><li><a href="global.html#COMMON_FORM_CONTROLS">COMMON_FORM_CONTROLS</a></li><li><a href="global.html#Cookie">Cookie</a></li><li><a href="global.html#copyStream">copyStream</a></li><li><a href="global.html#createATouch">createATouch</a></li><li><a href="global.html#deleteSession">deleteSession</a></li><li><a href="global.html#delimitedRead">delimitedRead</a></li><li><a href="global.html#DISABLED_ATTRIBUTE_SUPPORTED_XUL">DISABLED_ATTRIBUTE_SUPPORTED_XUL</a></li><li><a href="global.html#dispatchKeyDown">dispatchKeyDown</a></li><li><a href="global.html#dispatchKeyUp">dispatchKeyUp</a></li><li><a href="global.html#dispatchPause">dispatchPause</a></li><li><a href="global.html#dispatchPointerDown">dispatchPointerDown</a></li><li><a href="global.html#dispatchPointerMove">dispatchPointerMove</a></li><li><a href="global.html#dispatchPointerUp">dispatchPointerUp</a></li><li><a href="global.html#filterLinks">filterLinks</a></li><li><a href="global.html#findElement">findElement</a></li><li><a href="global.html#findElementContent">findElementContent</a></li><li><a href="global.html#findElements">findElements</a></li><li><a href="global.html#findElementsContent">findElementsContent</a></li><li><a href="global.html#focusElement">focusElement</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#getActiveElement">getActiveElement</a></li><li><a href="global.html#getElementRect">getElementRect</a></li><li><a href="global.html#getElementTagName">getElementTagName</a></li><li><a href="global.html#getElementText">getElementText</a></li><li><a href="global.html#getElementValueOfCssProperty">getElementValueOfCssProperty</a></li><li><a href="global.html#getOuterWindowId">getOuterWindowId</a></li><li><a href="global.html#getPageSource">getPageSource</a></li><li><a href="global.html#goBack">goBack</a></li><li><a href="global.html#goForward">goForward</a></li><li><a href="global.html#hex">hex</a></li><li><a href="global.html#INPUT_TYPES_NO_EVENT">INPUT_TYPES_NO_EVENT</a></li><li><a href="global.html#isElementDisplayed">isElementDisplayed</a></li><li><a href="global.html#isElementEnabled">isElementEnabled</a></li><li><a href="global.html#isElementSelected">isElementSelected</a></li><li><a href="global.html#JSONPacket">JSONPacket</a></li><li><a href="global.html#KEY_LOCATION_LOOKUP">KEY_LOCATION_LOOKUP</a></li><li><a href="global.html#loadListener">loadListener</a></li><li><a href="global.html#LocalDebuggerTransport">LocalDebuggerTransport</a></li><li><a href="global.html#MessageOrigin">MessageOrigin</a></li><li><a href="global.html#MODIFIER_NAME_LOOKUP">MODIFIER_NAME_LOOKUP</a></li><li><a href="global.html#multiAction">multiAction</a></li><li><a href="global.html#newSession">newSession</a></li><li><a href="global.html#NORMALIZED_KEY_LOOKUP">NORMALIZED_KEY_LOOKUP</a></li><li><a href="global.html#performActions">performActions</a></li><li><a href="global.html#RawPacket">RawPacket</a></li><li><a href="global.html#refresh">refresh</a></li><li><a href="global.html#registerSelf">registerSelf</a></li><li><a href="global.html#releaseActions">releaseActions</a></li><li><a href="global.html#removeMessageListenerId">removeMessageListenerId</a></li><li><a href="global.html#resetValues">resetValues</a></li><li><a href="global.html#ResponseBody">ResponseBody</a></li><li><a href="global.html#restart">restart</a></li><li><a href="global.html#SELECTED_PROPERTY_SUPPORTED_XUL">SELECTED_PROPERTY_SUPPORTED_XUL</a></li><li><a href="global.html#sendError">sendError</a></li><li><a href="global.html#sendOk">sendOk</a></li><li><a href="global.html#sendResponse">sendResponse</a></li><li><a href="global.html#sendToServer">sendToServer</a></li><li><a href="global.html#set">set</a></li><li><a href="global.html#singleTap">singleTap</a></li><li><a href="global.html#sleepSession">sleepSession</a></li><li><a href="global.html#startListeners">startListeners</a></li><li><a href="global.html#switchToFrame">switchToFrame</a></li><li><a href="global.html#switchToParentFrame">switchToParentFrame</a></li><li><a href="global.html#switchToShadowRoot">switchToShadowRoot</a></li><li><a href="global.html#takeScreenshot">takeScreenshot</a></li><li><a href="global.html#TimedPromise">TimedPromise</a></li><li><a href="global.html#toEvents">toEvents</a></li><li><a href="global.html#waitForPageLoaded">waitForPageLoaded</a></li><li><a href="global.html#WindowState">WindowState</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Tue Aug 15 2017 19:56:03 GMT+0100 (BST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>