selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
27 lines • 5.97 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>WebDriver.Window</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>Namespace:</b> <a href="namespace_webdriver.html">webdriver</a></div><div class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1398">View Source</a></div><h1>class WebDriver.Window</h1><p>An interface for managing the current window.</p>
<h3>new WebDriver.Window(<wbr>driver)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>driver<code><a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code><dd><p>The parent driver.</p>
</dl></div></div><h2>Instance Methods</h2><div id="getPosition" class="function"><div><h3>getPosition()<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1412">code »</a></span></h3><p>Retrieves the window's current position, relative to the top left corner of
the screen.</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><{x: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, y: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}></code><dd><p>A promise that
will be resolved with the window's position in the form of a
{x:number, y:number} object literal.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="getSize" class="function"><div><h3>getSize()<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1445">code »</a></span></h3><p>Retrieves the window's current size.</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><{height: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, width: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}></code><dd><p>A
promise that will be resolved with the window's size in the form of a
{width:number, height:number} object literal.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="maximize" class="function"><div><h3>maximize()<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1475">code »</a></span></h3><p>Maximizes the current window.</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><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>></code><dd><p>A promise that will be resolved
when the command has completed.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="setPosition" class="function"><div><h3>setPosition(<wbr>x, y)<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1429">code »</a></span></h3><p>Repositions the current window.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>x<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The desired horizontal position, relative to the left side
of the screen.</p>
<dt>y<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The desired vertical position, relative to the top of the
of the screen.</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><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>></code><dd><p>A promise that will be resolved
when the command has completed.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="setSize" class="function"><div><h3>setSize(<wbr>width, height)<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1460">code »</a></span></h3><p>Resizes the current window.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>width<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The desired window width.</p>
<dt>height<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The desired window height.</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><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>></code><dd><p>A promise that will be resolved
when the command has completed.</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>