UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

40 lines 11.2 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>SeleniumServer</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_remote.html">selenium-webdriver/remote</a></div><div class="codelink"><a href="source/remote/index.js.src.html#l366">View Source</a></div><h1>class SeleniumServer</h1><pre class="inheritance"><a href="module_selenium-webdriver_remote_class_DriverService.html">DriverService</a> &#x2514; SeleniumServer</pre><p>Manages the life and death of the <a href="http://selenium-release.storage.googleapis.com/index.html"> standalone Selenium server</a>.</p> <h3>new SeleniumServer(<wbr>jar, opt_options)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>jar<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>Path to the Selenium server jar.</p> <dt>opt_options<code>{args: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>), env: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>), jvmArgs: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>), port: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>), stdio: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;?(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|Stream)&gt;|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)}=</code><dd><p>Configuration options for the server.</p> </dl></div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><dd><p>If the path to the Selenium jar is not specified or if an invalid port is specified.</p> </dl></div></div><h2>Instance Methods</h2><div id="address" class="function"><div><h3>address()<span class="codelink"><a href="source/remote/index.js.src.html#l131">code »</a></span></h3><p><b>Defined by: </b><a href="module_selenium-webdriver_remote_class_DriverService.html#address">DriverService</a></p><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise that resolves to the server&#39;s address.</p> </dl></div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><dd><p>If the server has not been started.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="isRunning" class="function"><div><h3>isRunning()<span class="codelink"><a href="source/remote/index.js.src.html#l144">code »</a></span></h3><p>Returns whether the underlying process is still running. This does not take into account whether the process is in the process of shutting down.</p> <p><b>Defined by: </b><a href="module_selenium-webdriver_remote_class_DriverService.html#isRunning">DriverService</a></p><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>Whether the underlying service process is running.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="kill" class="function"><div><h3>kill()<span class="codelink"><a href="source/remote/index.js.src.html#l223">code »</a></span></h3><p>Stops the service if it is not currently running. This function will kill the server immediately. To synchronize with the active control flow, use <a href="module_selenium-webdriver_remote_class_SeleniumServer.html#stop"><code>#stop()</code></a>.</p> <p><b>Defined by: </b><a href="module_selenium-webdriver_remote_class_DriverService.html#kill">DriverService</a></p><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise that will be resolved when the server has been stopped.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="start" class="function"><div><h3>start(<wbr>opt_timeoutMs)<span class="codelink"><a href="source/remote/index.js.src.html#l158">code »</a></span></h3><p>Starts the server if it is not already running.</p> <p><b>Defined by: </b><a href="module_selenium-webdriver_remote_class_DriverService.html#start">DriverService</a></p><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>opt_timeoutMs<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd><p>How long to wait, in milliseconds, for the server to start accepting requests. Defaults to 30 seconds.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise that will resolve to the server&#39;s base URL when it has started accepting requests. If the timeout expires before the server has started, the promise will be rejected.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="stop" class="function"><div><h3>stop()<span class="codelink"><a href="source/remote/index.js.src.html#l239">code »</a></span></h3><p>Schedules a task in the current control flow to stop the server if it is currently running.</p> <p><b>Defined by: </b><a href="module_selenium-webdriver_remote_class_DriverService.html#stop">DriverService</a></p><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise that will be resolved when the server has been stopped.</p> </dl></div></div></div></div><h2>Type Definitions</h2><div id="SeleniumServer.Options" class="property"><dl><dt><a href="source/remote/index.js.src.html#l314">SeleniumServer.Options</a><code>{args: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>), env: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>), jvmArgs: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>), port: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>), stdio: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&lt;?(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|Stream)&gt;|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)}</code><dd><p>Options for the Selenium server:</p> <ul><li><code>port</code> - The port to start the server on (must be &gt; 0). If the port is provided as a promise, the service will wait for the promise to resolve before starting.</li><li><code>args</code> - The arguments to pass to the service. If a promise is provided, the service will wait for it to resolve before starting.</li><li><code>jvmArgs</code> - The arguments to pass to the JVM. If a promise is provided, the service will wait for it to resolve before starting.</li><li><code>env</code> - The environment variables that should be visible to the server process. Defaults to inheriting the current process&#39;s environment.</li><li><code>stdio</code> - IO configuration for the spawned server process. For more information, refer to the documentation of <code>child_process.spawn</code>.</li></ul> </dl></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>