UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

24 lines 12.2 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.Builder</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class webdriver.Builder</h1><a class="source" href="source/lib/webdriver/builder.js.src.html#l32">code &raquo;</a><pre><code><a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a> &#x2514; webdriver.Builder</code></pre></header><section><h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.Builder <span class="args">( )</span></span></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><h3>Defined in <code class="type">webdriver.Builder</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l87">code &raquo;</a><span class="member"><a name="build">build</a> <span class="args">( )</span> &rArr; <code class="type">webdriver.WebDriver</code></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l79">code &raquo;</a><span class="member"><a name="getSession">getSession</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The ID of the session, if any, this builder is configured to reuse.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l69">code &raquo;</a><span class="member"><a name="usingSession">usingSession</a> <span class="args">( id )</span> &rArr; <code class="type">!<a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></span></div><p>Configures the builder to create a client that will use an existing WebDriver session.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>id: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The existing session ID to use.</dl><tr><th>Returns<tr><td><dl>This Builder instance for chain calling.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l112">code &raquo;</a><span class="member"><a name="getCapabilities">getCapabilities</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_Capabilities.html">webdriver.Capabilities</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The current desired capabilities for this builder.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l90">code &raquo;</a><span class="member"><a name="getServerUrl">getServerUrl</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The URL of the WebDriver server this instance is configured to use.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l124">code &raquo;</a><span class="member"><a name="setLoggingPreferences">setLoggingPreferences</a> <span class="args">( prefs )</span> &rArr; <code class="type">!<a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></span></div><p>Sets the logging preferences for the created session. Preferences may be changed by repeated calls, or by calling <code class="type"><a class="unresolved-link">#withCapabilities</a></code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>prefs: <code class="type">!(<a href="class_webdriver_logging_Preferences.html">webdriver.logging.Preferences</a>|<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;)</code><dd>The desired logging preferences.</dl><tr><th>Returns<tr><td><dl>This Builder instance for chain calling.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l80">code &raquo;</a><span class="member"><a name="usingServer">usingServer</a> <span class="args">( url )</span> &rArr; <code class="type">!<a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></span></div><p>Configures which WebDriver server should be used for new sessions. Overrides the value loaded from the <code class="type"><a href="class_webdriver_AbstractBuilder.html#webdriver.AbstractBuilder.SERVER_URL_ENV">webdriver.AbstractBuilder.SERVER_URL_ENV</a></code> upon creation of this instance.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>url: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>URL of the server to use.</dl><tr><th>Returns<tr><td><dl>This Builder instance for chain calling.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l102">code &raquo;</a><span class="member"><a name="withCapabilities">withCapabilities</a> <span class="args">( capabilities )</span> &rArr; <code class="type">!<a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></span></div><p>Sets the desired capabilities when requesting a new session. This will overwrite any previously set desired capabilities.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>capabilities: <code class="type">!(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>|<a href="class_webdriver_Capabilities.html">webdriver.Capabilities</a>)</code><dd>The desired capabilities for a new session.</dl><tr><th>Returns<tr><td><dl>This Builder instance for chain calling.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">webdriver.Builder</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l43">code &raquo;</a><span class="member"><a name="sessionId_">sessionId_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>ID of an existing WebDriver session that new clients should use. Initialized from the value of the <code class="type"><a class="unresolved-link">webdriver.AbstractBuilder.SESSION_ID_ENV</a></code> environment variable, but may be overridden using <code class="type"><a class="unresolved-link">webdriver.AbstractBuilder#usingSession</a></code>.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l49">code &raquo;</a><span class="member"><a name="capabilities_">capabilities_</a> : <code class="type">!<a href="class_webdriver_Capabilities.html">webdriver.Capabilities</a></code></span></div><p>The desired capabilities to use when creating a new session.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/abstractbuilder.js.src.html#l42">code &raquo;</a><span class="member"><a name="serverUrl_">serverUrl_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>URL of the remote server to use for new clients; initialized from the value of the <code class="type"><a href="class_webdriver_AbstractBuilder.html#webdriver.AbstractBuilder.SERVER_URL_ENV">webdriver.AbstractBuilder.SERVER_URL_ENV</a></code> environment variable, but may be overridden using <code class="type"><a href="class_webdriver_AbstractBuilder.html#usingServer">webdriver.AbstractBuilder#usingServer</a></code>.</summary></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l60">code &raquo;</a><span class="member"><a name="webdriver.Builder.SESSION_ID_ENV">webdriver.Builder.SESSION_ID_ENV</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Environment variable that defines the session ID of an existing WebDriver session to use when creating clients. If set, all new Builder instances will default to creating clients that use this session. To create a new session, use <code >#useExistingSession(boolean)</code>. The use of this environment variable requires that <code class="type"><a href="class_webdriver_AbstractBuilder.html#webdriver.AbstractBuilder.SERVER_URL_ENV">webdriver.AbstractBuilder.SERVER_URL_ENV</a></code> also be set.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/builder.js.src.html#l32">code &raquo;</a><span class="member"><a name="webdriver.Builder.superClass_">webdriver.Builder.superClass_</a> : <code class="type"><a href="class_webdriver_AbstractBuilder.html">webdriver.AbstractBuilder.prototype</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>