selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
12 lines • 4.54 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>Locator</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/locators.js.src.html#l38">View Source</a></div><h1>class Locator</h1><p>An element locator.</p>
<h3>new Locator(<wbr>using, value)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>using<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The type of strategy to use for this locator.</p>
<dt>value<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The search target of this locator.</p>
</dl></div></div><h2>Instance Methods</h2><div id="toString" class="function"><div><h3>toString()<span class="codelink"><a href="source/lib/webdriver/locators.js.src.html#l253">code »</a></span></h3><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></dl></div></div></div></div><h2>Instance Properties</h2><div id="using" class="property"><dl><dt><a href="source/lib/webdriver/locators.js.src.html#l44">using</a><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The search strategy to use when searching for an element.</p>
</dl></div><div id="value" class="property"><dl><dt><a href="source/lib/webdriver/locators.js.src.html#l50">value</a><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The search target for this locator.</p>
</dl></div><h2>Static Functions</h2><div id="Locator.checkLocator" class="function"><div><h3>Locator.checkLocator(<wbr>value)<span class="codelink"><a href="source/lib/webdriver/locators.js.src.html#l237">code »</a></span></h3><p>Verifies that a <code>value</code> is a valid locator to use for searching for
elements on the page.</p>
<div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>value<code>*</code><dd><p>The value to check is a valid locator.</p>
</dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|Function)</code><dd><p>A valid locator object or function.</p>
</dl></div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError">TypeError</a></code><dd><p>If the given value is an invalid locator.</p>
</dl></div></div></div></div><h2>Static Properties</h2><div id="Locator.Strategy" class="property"><dl><dt><a href="source/lib/webdriver/locators.js.src.html#l216">Locator.Strategy</a><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): (Function|<a href="class_webdriver_Locator.html">webdriver.Locator</a>)></code><dd><p>Maps <a href="namespace_webdriver_By.html#By.Hash"><code>webdriver.By.Hash</code></a> keys to the appropriate factory function.</p>
</dl></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>