selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
22 lines • 4.51 kB
HTML
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Executor</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article><div class="parentlink"><b>Module:</b> <a href="module_selenium-webdriver_http.html">selenium-webdriver/http</a></div><div class="codelink"><a href="source/http/index.js.src.html#l187">View Source</a></div><h1>class Executor</h1><dl><dt>Alias for <code><a href="class_webdriver_http_Executor.html">webdriver.http.Executor</a></code><dt>All implemented interfaces<dd><code><a href="interface_webdriver_CommandExecutor.html">webdriver.CommandExecutor</a></code></dl><p>A command executor that communicates with a server using the WebDriver
command protocol.</p>
<h3>new Executor(<wbr>client)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>client<code><a href="interface_webdriver_http_Client.html">webdriver.http.Client</a></code><dd><p>The client to use when sending
requests to the server.</p>
</dl></div></div><h2>Instance Methods</h2><div id="defineCommand" class="function"><div><h3>defineCommand(<wbr>name, method, path)<span class="codelink"><a href="source/lib/webdriver/http/http.js.src.html#l102">code »</a></span></h3><p>Defines a new command for use with this executor. When a command is sent,
the <code>path</code> will be preprocessed using the command's parameters; any
path segments prefixed with ":" will be replaced by the parameter of the
same name. For example, given "/person/:name" and the parameters
"{name: 'Bob'}", the final command path will be "/person/Bob".</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>name<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The command name.</p>
<dt>method<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The HTTP method to use when sending this command.</p>
<dt>path<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The path to send the command to, relative to
the WebDriver server's command root and of the form
"/path/:variable/segment".</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="execute" class="function"><div><h3>execute(<wbr>command, callback)<span class="codelink"><a href="source/lib/webdriver/http/http.js.src.html#l109">code »</a></span></h3><p>Executes the given <code>command</code>. If there is an error executing the
command, the provided callback will be invoked with the offending error.
Otherwise, the callback will be invoked with a null Error and non-null
<a href="namespace_bot_response.html#response.ResponseObject"><code>bot.response.ResponseObject</code></a> object.</p>
<p><b>Specified by: </b><a href="interface_webdriver_CommandExecutor.html#execute">webdriver.CommandExecutor</a></p><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>command<code><a href="class_webdriver_Command.html">webdriver.Command</a></code><dd><p>The command to execute.</p>
<dt>callback<code>function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, {status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}=): ?</code><dd><p>the function
to invoke when the command response is ready.</p>
</dl></div></div></div></div></article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>