Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TraversableElement.php

function TraversableElement::fillField

Fills in field (input, textarea, select) with specified locator.

Parameters

string $locator input id, name or label:

string|bool|array $value value:

Return value

void

Throws

ElementNotFoundException

See also

NodeElement::setValue

File

vendor/behat/mink/src/Element/TraversableElement.php, line 158

Class

TraversableElement
Traversable element.

Namespace

Behat\Mink\Element

Code

public function fillField(string $locator, $value) {
    $field = $this->findField($locator);
    if (null === $field) {
        throw new ElementNotFoundException($this->getDriver(), 'form field', 'id|name|label|value|placeholder', $locator);
    }
    $field->setValue($value);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal