UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

29 lines 5.36 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>WebDriver.Timeouts</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#l1323">View Source</a></div><h1>class WebDriver.Timeouts</h1><p>An interface for managing timeout behavior for WebDriver instances.</p> <h3>new WebDriver.Timeouts(<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="implicitlyWait" class="function"><div><h3>implicitlyWait(<wbr>ms)<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1351">code »</a></span></h3><p>Specifies the amount of time the driver should wait when searching for an element if it is not immediately present.</p> <p>When searching for a single element, the driver should poll the page until the element has been found, or this timeout expires before failing with a <a href="enum_bot_ErrorCode.html#NO_SUCH_ELEMENT"><code>bot.ErrorCode.NO_SUCH_ELEMENT</code></a> error. When searching for multiple elements, the driver should poll the page until at least one element has been found or this timeout has expired.</p> <p>Setting the wait timeout to 0 (its default value), disables implicit waiting.</p> <p>Increasing the implicit wait timeout should be used judiciously as it will have an adverse effect on test run time, especially when used with slower location strategies like XPath.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>ms<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The amount of time to wait, in milliseconds.</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>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>&gt;</code><dd><p>A promise that will be resolved when the implicit wait timeout has been set.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="pageLoadTimeout" class="function"><div><h3>pageLoadTimeout(<wbr>ms)<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1383">code »</a></span></h3><p>Sets the amount of time to wait for a page load to complete before returning an error. If the timeout is negative, page loads may be indefinite.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>ms<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The amount of time to wait, in milliseconds.</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>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>&gt;</code><dd><p>A promise that will be resolved when the timeout has been set.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setScriptTimeout" class="function"><div><h3>setScriptTimeout(<wbr>ms)<span class="codelink"><a href="source/lib/webdriver/webdriver.js.src.html#l1368">code »</a></span></h3><p>Sets the amount of time to wait, in milliseconds, for an asynchronous script to finish execution before returning an error. If the timeout is less than or equal to 0, the script will be allowed to run indefinitely.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>ms<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The amount of time to wait, in milliseconds.</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>&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>&gt;</code><dd><p>A promise that will be resolved when the script timeout has been set.</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>