selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
28 lines (27 loc) • 5.71 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>selenium-webdriver/proxy</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="codelink"><a href="source/proxy.js.src.html#l30">View Source</a></div><h1>module selenium-webdriver/proxy</h1><p>Defines functions for configuring a webdriver proxy:</p>
<pre><code>var webdriver = require('selenium-webdriver'),
proxy = require('selenium-webdriver/proxy');
var driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
.setProxy(proxy.manual({http: 'host:1234'}))
.build();
</code></pre>
<h2>Functions</h2><div id="direct" class="function"><div><h3>direct()<span class="codelink"><a href="source/proxy.js.src.html#l43">code »</a></span></h3><p>Configures WebDriver to bypass all browser proxies.</p>
<div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{proxyType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}</code><dd><p>A new proxy configuration object.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="manual" class="function"><div><h3>manual(<wbr>options)<span class="codelink"><a href="source/proxy.js.src.html#l69">code »</a></span></h3><p>Manually configures the browser proxy. The following options are
supported:</p>
<ul><li><code>ftp</code>: Proxy host to use for FTP requests</li><li><code>http</code>: Proxy host to use for HTTP requests</li><li><code>https</code>: Proxy host to use for HTTPS requests</li><li><code>bypass</code>: A list of hosts requests should directly connect to,
bypassing any other proxies for that request. May be specified as a
comma separated string, or a list of strings.</li></ul>
<p>Behavior is undefined for FTP, HTTP, and HTTPS requests if the
corresponding key is omitted from the configuration options.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>options<code>{bypass: (<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><<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/Undefined">undefined</a>), ftp: (<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/Undefined">undefined</a>), http: (<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/Undefined">undefined</a>), https: (<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/Undefined">undefined</a>)}</code><dd><p>Proxy
configuration options.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{proxyType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}</code><dd><p>A new proxy configuration object.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="pac" class="function"><div><h3>pac(<wbr>url)<span class="codelink"><a href="source/proxy.js.src.html#l87">code »</a></span></h3><p>Configures WebDriver to configure the browser proxy using the PAC file at
the given URL.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>url<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>URL for the PAC proxy to use.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{proxyType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}</code><dd><p>A new proxy configuration object.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="system" class="function"><div><h3>system()<span class="codelink"><a href="source/proxy.js.src.html#l99">code »</a></span></h3><p>Configures WebDriver to use the current system's proxy.</p>
<div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{proxyType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}</code><dd><p>A new proxy configuration object.</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>