class Locator

An element locator.

new Locator(using, value)

Parameters
usingstring

The type of strategy to use for this locator.

valuestring

The search target of this locator.

Instance Methods

toString()code »

Returns
string

Instance Properties

usingstring

The search strategy to use when searching for an element.

valuestring

The search target for this locator.

Static Functions

Locator.checkLocator(value)code »

Verifies that a value is a valid locator to use for searching for elements on the page.

Parameters
value*

The value to check is a valid locator.

Returns
(webdriver.Locator|Function)

A valid locator object or function.

Throws
TypeError

If the given value is an invalid locator.

Static Properties

Locator.StrategyObject<string, function(string): (Function|webdriver.Locator)>

Maps webdriver.By.Hash keys to the appropriate factory function.