You are here

public function NodeElement::getValue in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/src/Element/NodeElement.php \Behat\Mink\Element\NodeElement::getValue()

Returns the value of the form field or option element.

For checkbox fields, the value is a boolean indicating whether the checkbox is checked. For radio buttons, the value is the value of the selected button in the radio group or null if no button is selected. For single select boxes, the value is the value of the selected option. For multiple select boxes, the value is an array of selected option values. for file inputs, the return value is undefined given that browsers don't allow accessing the value of file inputs for security reasons. Some drivers may allow accessing the path of the file set in the field, but this is not required if it cannot be implemented. For textarea elements and all textual fields, the value is the content of the field. Form option elements, the value is the value of the option (the value attribute or the text content if the attribute is not set).

Calling this method on other elements than form fields or option elements is not allowed.

Return value

string|bool|array

File

vendor/behat/mink/src/Element/NodeElement.php, line 89

Class

NodeElement
Page element node.

Namespace

Behat\Mink\Element

Code

public function getValue() {
  return $this
    ->getDriver()
    ->getValue($this
    ->getXpath());
}