selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
82 lines • 20.4 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>until</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.html">selenium-webdriver</a></div><div class="codelink"><a href="source/index.js.src.html#l146">View Source</a></div><h1>namespace until</h1><dl><dt>Alias for <code><a href="namespace_webdriver_until.html">webdriver.until</a></code></dl><h2>Functions</h2><div id="ableToSwitchToFrame" class="function"><div><h3>ableToSwitchToFrame(<wbr>frame)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l103">code »</a></span></h3><p>Creates a condition that will wait until the input driver is able to switch
to the designated frame. The target frame may be specified as</p>
<ol><li>a numeric index into
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Window.frames">window.frames</a>
for the currently selected frame.</li><li>a <a href="class_webdriver_WebElement.html"><code>webdriver.WebElement</code></a>, which must reference a FRAME or IFRAME
element on the current page.</li><li>a locator which may be used to first locate a FRAME or IFRAME on the
current page before attempting to switch to it.</li></ol>
<p>Upon successful resolution of this condition, the driver will be left
focused on the new frame.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>frame<code>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|<a href="class_webdriver_WebElement.html">webdriver.WebElement</a>|<a href="class_webdriver_Locator.html">webdriver.Locator</a>|{className: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{css: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{js: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{linkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{partialLinkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{tagName: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{xpath: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>})</code><dd><p>The frame identifier.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>A new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="alertIsPresent" class="function"><div><h3>alertIsPresent()<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l139">code »</a></span></h3><p>Creates a condition that waits for an alert to be opened. Upon success, the
returned promise will be fulfilled with the handle for the opened alert.</p>
<div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="class_webdriver_Alert.html">webdriver.Alert</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsDisabled" class="function"><div><h3>elementIsDisabled(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l319">code »</a></span></h3><p>Creates a condition that will wait for the given element to be disabled.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsEnabled" class="function"><div><h3>elementIsEnabled(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l305">code »</a></span></h3><p>Creates a condition that will wait for the given element to be enabled.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsNotSelected" class="function"><div><h3>elementIsNotSelected(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l348">code »</a></span></h3><p>Creates a condition that will wait for the given element to be deselected.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsNotVisible" class="function"><div><h3>elementIsNotVisible(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l289">code »</a></span></h3><p>Creates a condition that will wait for the given element to be in the DOM,
yet not visible to the user.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsSelected" class="function"><div><h3>elementIsSelected(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l334">code »</a></span></h3><p>Creates a condition that will wait for the given element to be selected.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementIsVisible" class="function"><div><h3>elementIsVisible(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l274">code »</a></span></h3><p>Creates a condition that will wait for the given element to become visible.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementLocated" class="function"><div><h3>elementLocated(<wbr>locator)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l211">code »</a></span></h3><p>Creates a condition that will loop until an element is
<a href="class_webdriver_WebDriver.html#findElement"><code>found</code></a> with the given locator.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>locator<code>(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|{className: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{css: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{js: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{linkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{partialLinkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{tagName: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{xpath: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>})</code><dd><p>The locator
to use.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="class_webdriver_WebElement.html">webdriver.WebElement</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementTextContains" class="function"><div><h3>elementTextContains(<wbr>element, substr)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l386">code »</a></span></h3><p>Creates a condition that will wait for the given element's
<a href="class_webdriver_WebDriver.html"><code>visible text</code></a> to contain the given
substring.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
<dt>substr<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The substring to search for.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementTextIs" class="function"><div><h3>elementTextIs(<wbr>element, text)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l367">code »</a></span></h3><p>Creates a condition that will wait for the given element's
<a href="class_webdriver_WebDriver.html"><code>visible text</code></a> to match the given
<code>text</code> exactly.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
<dt>text<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The expected text.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementTextMatches" class="function"><div><h3>elementTextMatches(<wbr>element, regex)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l405">code »</a></span></h3><p>Creates a condition that will wait for the given element's
<a href="class_webdriver_WebDriver.html"><code>visible text</code></a> to match a regular
expression.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element to test.</p>
<dt>regex<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp">RegExp</a></code><dd><p>The regular expression to test against.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="elementsLocated" class="function"><div><h3>elementsLocated(<wbr>locator)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l232">code »</a></span></h3><p>Creates a condition that will loop until at least one element is
<a href="class_webdriver_WebDriver.html#findElement"><code>found</code></a> with the given locator.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>locator<code>(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|{className: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{css: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{js: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{linkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{partialLinkText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{tagName: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>}|{xpath: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>})</code><dd><p>The locator
to use.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><<a href="class_webdriver_WebElement.html">webdriver.WebElement</a>>></code><dd><p>The new
condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="stalenessOf" class="function"><div><h3>stalenessOf(<wbr>element)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l253">code »</a></span></h3><p>Creates a condition that will wait for the given element to become stale. An
element is considered stale once it is removed from the DOM, or a new page
has loaded.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>element<code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code><dd><p>The element that should become stale.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="titleContains" class="function"><div><h3>titleContains(<wbr>substr)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l176">code »</a></span></h3><p>Creates a condition that will wait for the current page's title to contain
the given substring.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>substr<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The substring that should be present in the page
title.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="titleIs" class="function"><div><h3>titleIs(<wbr>title)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l157">code »</a></span></h3><p>Creates a condition that will wait for the current page's title to match the
given value.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>title<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The expected page title.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><hr class="fn-sep"><div id="titleMatches" class="function"><div><h3>titleMatches(<wbr>regex)<span class="codelink"><a href="source/lib/webdriver/until.js.src.html#l194">code »</a></span></h3><p>Creates a condition that will wait for the current page's title to match the
given regular expression.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>regex<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp">RegExp</a></code><dd><p>The regular expression to test against.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_until_Condition.html">webdriver.until.Condition</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code><dd><p>The new condition.</p>
</dl></div></div></div></div><h2>Types</h2><dl><dt><a href="class_webdriver_until_Condition.html">Condition</a><dd><p>Defines a condition to</p>
</dl></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>