class WebDriverBy (View source)

The basic 8 mechanisms supported by webdriver to locate a web element.

ie. 'class name', 'css selector', 'id', 'name', 'link text', 'partial link text', 'tag name' and 'xpath'.

Methods

__construct($mechanism, $value)

No description

string
getMechanism()

No description

string
getValue()

No description

static WebDriverBy
className(string $class_name)

Locates elements whose class name contains the search value; compound class names are not permitted.

static WebDriverBy
cssSelector(string $css_selector)

Locates elements matching a CSS selector.

static WebDriverBy
id(string $id)

Locates elements whose ID attribute matches the search value.

static WebDriverBy
name(string $name)

Locates elements whose NAME attribute matches the search value.

static WebDriverBy
linkText(string $link_text)

Locates anchor elements whose visible text matches the search value.

static WebDriverBy
partialLinkText(string $partial_link_text)

Locates anchor elements whose visible text partially matches the search value.

static WebDriverBy
tagName(string $tag_name)

Locates elements whose tag name matches the search value.

static WebDriverBy
xpath(string $xpath)

Locates elements matching an XPath expression.

Details

protected __construct($mechanism, $value)

No description

Parameters

$mechanism
$value

string getMechanism()

No description

Return Value

string

string getValue()

No description

Return Value

string

static WebDriverBy className(string $class_name)

Locates elements whose class name contains the search value; compound class names are not permitted.

Parameters

string $class_name

Return Value

WebDriverBy

static WebDriverBy cssSelector(string $css_selector)

Locates elements matching a CSS selector.

Parameters

string $css_selector

Return Value

WebDriverBy

static WebDriverBy id(string $id)

Locates elements whose ID attribute matches the search value.

Parameters

string $id

Return Value

WebDriverBy

static WebDriverBy name(string $name)

Locates elements whose NAME attribute matches the search value.

Parameters

string $name

Return Value

WebDriverBy

static WebDriverBy linkText(string $link_text)

Locates anchor elements whose visible text matches the search value.

Parameters

string $link_text

Return Value

WebDriverBy

static WebDriverBy partialLinkText(string $partial_link_text)

Locates anchor elements whose visible text partially matches the search value.

Parameters

string $partial_link_text

Return Value

WebDriverBy

static WebDriverBy tagName(string $tag_name)

Locates elements whose tag name matches the search value.

Parameters

string $tag_name

Return Value

WebDriverBy

static WebDriverBy xpath(string $xpath)

Locates elements matching an XPath expression.

Parameters

string $xpath

Return Value

WebDriverBy